Class: Nuntius::Admin::LayoutsController
- Inherits:
-
Nuntius::ApplicationAdminController
- Object
- Nuntius::ApplicationController
- Nuntius::ApplicationAdminController
- Nuntius::Admin::LayoutsController
- Defined in:
- app/controllers/nuntius/admin/layouts_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
17 18 19 20 21 |
# File 'app/controllers/nuntius/admin/layouts_controller.rb', line 17 def create @layout = Nuntius::Layout.new(layout_params) @layout.save respond_with :admin, @layout end |
#destroy ⇒ Object
42 43 44 45 46 |
# File 'app/controllers/nuntius/admin/layouts_controller.rb', line 42 def destroy @layout = Nuntius::Layout.visible.find(params[:id]) @layout.destroy respond_with @layout end |
#edit ⇒ Object
23 24 25 |
# File 'app/controllers/nuntius/admin/layouts_controller.rb', line 23 def edit @layout = Nuntius::Layout.visible.find(params[:id]) end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/nuntius/admin/layouts_controller.rb', line 8 def index @layouts = Nuntius::Layout.visible.order(:name) end |
#new ⇒ Object
12 13 14 15 |
# File 'app/controllers/nuntius/admin/layouts_controller.rb', line 12 def new @layout = Nuntius::Layout.new render :edit end |
#show ⇒ Object
27 28 29 |
# File 'app/controllers/nuntius/admin/layouts_controller.rb', line 27 def show redirect_to :edit_admin_layout, status: :see_other end |
#update ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/nuntius/admin/layouts_controller.rb', line 31 def update @layout = Nuntius::Layout.visible.find(params[:id]) @layout.update(layout_params) if params[:layout][:attachments].present? params[:layout][:attachments].each do || @layout..attach() end end respond_with :admin, @layout end |