Class: Paginas::CategoriesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Paginas::CategoriesController
- Defined in:
- app/controllers/paginas/categories_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
15 16 17 18 19 20 21 22 |
# File 'app/controllers/paginas/categories_controller.rb', line 15 def create @category = Category.new(category_params) if @category.save redirect_to @category, notice: 'Category was successfully created.' else render :new end end |
#destroy ⇒ Object
30 31 32 33 |
# File 'app/controllers/paginas/categories_controller.rb', line 30 def destroy @category.destroy redirect_to categories_url, notice: 'Category was successfully destroyed.' end |
#edit ⇒ Object
13 14 |
# File 'app/controllers/paginas/categories_controller.rb', line 13 def edit end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/paginas/categories_controller.rb', line 5 def index @categories = Category.all end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/paginas/categories_controller.rb', line 10 def new @category = Category.new end |
#show ⇒ Object
8 9 |
# File 'app/controllers/paginas/categories_controller.rb', line 8 def show end |
#update ⇒ Object
23 24 25 26 27 28 29 |
# File 'app/controllers/paginas/categories_controller.rb', line 23 def update if @category.update(category_params) redirect_to @category, notice: 'Category was successfully updated.' else render :edit end end |