Class: Nuntius::Admin::TemplatesController
- Inherits:
-
Nuntius::ApplicationAdminController
- Object
- Nuntius::ApplicationController
- Nuntius::ApplicationAdminController
- Nuntius::Admin::TemplatesController
- Defined in:
- app/controllers/nuntius/admin/templates_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
19 20 21 22 23 |
# File 'app/controllers/nuntius/admin/templates_controller.rb', line 19 def create @template = Nuntius::Template.new(template_params) @template.save respond_with :admin, @template, action: :edit end |
#destroy ⇒ Object
39 40 41 42 43 |
# File 'app/controllers/nuntius/admin/templates_controller.rb', line 39 def destroy @template = Nuntius::Template.visible.find(params[:id]) @template.destroy respond_with :admin, @template end |
#edit ⇒ Object
25 26 27 |
# File 'app/controllers/nuntius/admin/templates_controller.rb', line 25 def edit @template = Nuntius::Template.visible.find(params[:id]) end |
#index ⇒ Object
10 11 12 |
# File 'app/controllers/nuntius/admin/templates_controller.rb', line 10 def index @templates = Nuntius::Template.visible.order(:description) end |
#new ⇒ Object
14 15 16 17 |
# File 'app/controllers/nuntius/admin/templates_controller.rb', line 14 def new @template = Nuntius::Template.new render :edit end |
#show ⇒ Object
29 30 31 |
# File 'app/controllers/nuntius/admin/templates_controller.rb', line 29 def show redirect_to :edit_admin_template, status: :see_other end |