Class: SimpleForm::Bulma::ItemsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SimpleForm::Bulma::ItemsController
- Defined in:
- app/controllers/simple_form/bulma/items_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /items.
-
#index ⇒ Object
GET /items.
-
#new ⇒ Object
GET /items/new.
Instance Method Details
#create ⇒ Object
POST /items
16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/simple_form/bulma/items_controller.rb', line 16 def create @item = Item.new(item_params) if @item.valid? Item.all << @item redirect_to @item, notice: 'Item was successfully created.' else render :new end end |
#index ⇒ Object
GET /items
6 7 8 |
# File 'app/controllers/simple_form/bulma/items_controller.rb', line 6 def index @items = Item.all end |
#new ⇒ Object
GET /items/new
11 12 13 |
# File 'app/controllers/simple_form/bulma/items_controller.rb', line 11 def new @item = Item.new end |