Add Item, Page, Component, Link inheritanced models

This commit is contained in:
Wen-Tien Chang committed 2010-01-14 18:30:53 +08:00
1 parent cd21cadfe7
commit e1440a79d8
38 files changed
+417 -175

No files matched your search

@@ -31,6 +31,13 @@ class ApplicationController < ActionController::Base
I18n.locale = session[:locale] || I18n.default_locale
end
def find_parent_item
@parent_item = Item.find_by_name(params[:parent_item_name] || 'root')
unless @parent_item
@parent_item = Page.create( :name => 'root', :title => t(:homepage), :layout_name => "root" )
end
end
def require_entry_name
render :text => 'missing entry_name' if params[:entry_name].blank?
return