From 36a2f1f3c085dd81171cf7d8220770d4ff921ab3 Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 7 Feb 2009 15:50:40 +0100 Subject: added globalize2 plugin as well as some modifications which use the new translation facilities. backend mostly. --- app/controllers/content_controller.rb | 1 + app/models/page.rb | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index 0fa9832..f5e62c1 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb @@ -6,6 +6,7 @@ class ContentController < ApplicationController # return a node though, the node is really a proxy object for pages. It # returns the most recent page associated to this node instead. def render_page + I18n.locale = params[:language] path = params[:page_path].join('/') @page = Node.find_page(path) diff --git a/app/models/page.rb b/app/models/page.rb index 4fcee8c..df8308b 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -1,10 +1,16 @@ class Page < ActiveRecord::Base - belongs_to :node - + # Mixins and Plugins acts_as_taggable acts_as_list :column => :revision, :scope => :node_id + translates :title, :abstract, :body # Globalize2 + + # Associations + belongs_to :node + + # Class Methods + # This method is most likely called from the ContentHelper.render_collection # method which aggregates pages into a collection, based on parameters it # recieves. This method then calls Page.aggregate with these parameters. @@ -27,4 +33,6 @@ class Page < ActiveRecord::Base :match_all => true, :order => "#{options[:order_by]} #{options[:order_direction]}") end + + # Instance Methods end \ No newline at end of file -- cgit v1.3