Class: Sites::Sections::CategoriesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Sites::Sections::CategoriesController
- Defined in:
- app/controllers/cas/sites/sections/categories_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/cas/sites/sections/categories_controller.rb', line 18 def create @category = ::Cas::Category.new(category_params) @category.section = @section if @category.save redirect_to site_section_categories_url(@site, @section), notice: 'Categoria salva com sucesso.' else render :new end end |
#edit ⇒ Object
15 16 |
# File 'app/controllers/cas/sites/sections/categories_controller.rb', line 15 def edit end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/cas/sites/sections/categories_controller.rb', line 7 def index @categories = @section.categories end |
#new ⇒ Object
11 12 13 |
# File 'app/controllers/cas/sites/sections/categories_controller.rb', line 11 def new @category = ::Cas::Category.new end |
#update ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/controllers/cas/sites/sections/categories_controller.rb', line 29 def update if @category.update(category_params) redirect_to site_section_categories_url(@site, @section), notice: 'Categoria salva com sucesso.' else render :edit end end |