Class: CmsAdmin::MenusController
- Inherits:
-
BaseController
- Object
- BaseController
- CmsAdmin::MenusController
- Defined in:
- app/controllers/cms_admin/menus_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/cms_admin/menus_controller.rb', line 18 def create @menu.save! flash[:success] = I18n.t('cms.menus.created') redirect_to :action => :index rescue ActiveRecord::RecordInvalid logger.detailed_error($!) flash.now[:error] = I18n.t('cms.menus.creation_failure') render :action => :new end |
#destroy ⇒ Object
38 39 40 41 42 |
# File 'app/controllers/cms_admin/menus_controller.rb', line 38 def destroy @menu.destroy flash[:success] = I18n.t('cms.menus.deleted') redirect_to :action => :index end |
#edit ⇒ Object
14 15 16 |
# File 'app/controllers/cms_admin/menus_controller.rb', line 14 def edit render end |
#index ⇒ Object
5 6 7 8 |
# File 'app/controllers/cms_admin/menus_controller.rb', line 5 def index return redirect_to :action => :new if @site..count == 0 @menus = @site. end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/cms_admin/menus_controller.rb', line 10 def new render end |
#update ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/cms_admin/menus_controller.rb', line 28 def update @menu.update_attributes!(params[:menu]) flash[:success] = I18n.t('cms.menus.updated') redirect_to :action => :index, :id => @menu rescue ActiveRecord::RecordInvalid logger.detailed_error($!) flash.now[:error] = I18n.t('cms.menus.update_failure') render :action => :index end |