Class: GacoCms::Admin::PageTypesController
- Inherits:
-
BaseController
- Object
- GacoCms::AdminController
- BaseController
- GacoCms::Admin::PageTypesController
- Defined in:
- app/controllers/gaco_cms/admin/page_types_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'app/controllers/gaco_cms/admin/page_types_controller.rb', line 18 def create page_type = PageType.new(page_type_params) if page_type.save redirect_to url_for(action: :index), notice: 'PageType saved' else render inline: page_type.errors..join(', ') end end |
#destroy ⇒ Object
39 40 41 42 |
# File 'app/controllers/gaco_cms/admin/page_types_controller.rb', line 39 def destroy @page_type.destroy! redirect_to url_for(action: :index), notice: 'PageType destroyed' end |
#edit ⇒ Object
27 28 29 |
# File 'app/controllers/gaco_cms/admin/page_types_controller.rb', line 27 def edit render :form end |
#index ⇒ Object
9 10 11 |
# File 'app/controllers/gaco_cms/admin/page_types_controller.rb', line 9 def index @page_types = PageType.all.title_ordered end |
#new ⇒ Object
13 14 15 16 |
# File 'app/controllers/gaco_cms/admin/page_types_controller.rb', line 13 def new @page_type = PageType.new render :form end |
#update ⇒ Object
31 32 33 34 35 36 37 |
# File 'app/controllers/gaco_cms/admin/page_types_controller.rb', line 31 def update if @page_type.update(page_type_params) redirect_to url_for(action: :index), notice: 'PageType saved' else render inline: @page_type.errors..join(', ') end end |