Class: ActiveCanvas::Admin::PageTypesController
- Inherits:
-
ActiveCanvas::ApplicationController
- Object
- ActiveCanvas::ApplicationController
- ActiveCanvas::Admin::PageTypesController
- Defined in:
- app/controllers/active_canvas/admin/page_types_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
20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/active_canvas/admin/page_types_controller.rb', line 20 def create @page_type = ActiveCanvas::PageType.new(page_type_params) if @page_type.save redirect_to admin_page_type_path(@page_type), notice: "Page type was successfully created." else render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
38 39 40 41 42 43 44 |
# File 'app/controllers/active_canvas/admin/page_types_controller.rb', line 38 def destroy if @page_type.destroy redirect_to admin_page_types_path, notice: "Page type was successfully deleted." else redirect_to admin_page_types_path, alert: @page_type.errors..join(", ") end end |
#edit ⇒ Object
17 18 |
# File 'app/controllers/active_canvas/admin/page_types_controller.rb', line 17 def edit end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/active_canvas/admin/page_types_controller.rb', line 6 def index @page_types = ActiveCanvas::PageType.order(:name) end |
#new ⇒ Object
13 14 15 |
# File 'app/controllers/active_canvas/admin/page_types_controller.rb', line 13 def new @page_type = ActiveCanvas::PageType.new end |
#show ⇒ Object
10 11 |
# File 'app/controllers/active_canvas/admin/page_types_controller.rb', line 10 def show end |
#update ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/controllers/active_canvas/admin/page_types_controller.rb', line 30 def update if @page_type.update(page_type_params) redirect_to admin_page_type_path(@page_type), notice: "Page type was successfully updated." else render :edit, status: :unprocessable_entity end end |