Class: Admin::MenusController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::MenusController
- Defined in:
- app/controllers/admin/menus_controller.rb
Instance Method Summary collapse
- #activate ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #duplicate ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#activate ⇒ Object
59 60 61 |
# File 'app/controllers/admin/menus_controller.rb', line 59 def activate render :text => @menu.activate end |
#create ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/admin/menus_controller.rb', line 27 def create if @menu.save flash[:notice] = t('menu.create.success').capitalize redirect_to([forgeos_cms, :edit, :admin, @menu]) else flash[:error] = t('menu.create.failed').capitalize render :action => 'new' end end |
#destroy ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'app/controllers/admin/menus_controller.rb', line 50 def destroy if @menu.destroy flash[:notice] = t('menu.destroy.success').capitalize else flash[:error] = t('menu.destroy.failed').capitalize end return redirect_to([forgeos_cms, :admin, :menus]) end |
#duplicate ⇒ Object
22 23 24 25 |
# File 'app/controllers/admin/menus_controller.rb', line 22 def duplicate @menu = @menu.clone render :action => 'new' end |
#edit ⇒ Object
37 38 |
# File 'app/controllers/admin/menus_controller.rb', line 37 def edit end |
#index ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/admin/menus_controller.rb', line 6 def index respond_to do |format| format.html format.json do sort render :layout => false end end end |
#new ⇒ Object
19 20 |
# File 'app/controllers/admin/menus_controller.rb', line 19 def new end |
#show ⇒ Object
16 17 |
# File 'app/controllers/admin/menus_controller.rb', line 16 def show end |
#update ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'app/controllers/admin/menus_controller.rb', line 40 def update if @menu.update_attributes(params[:menu]) flash[:notice] = t('menu.update.success').capitalize redirect_to([forgeos_cms, :edit, :admin, @menu]) else flash[:error] = t('menu.update.failed').capitalize render(:action => 'edit') end end |