Class: Gamification::ItemsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Gamification::ItemsController
- Defined in:
- app/controllers/gamification/items_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /gamification/items.
-
#destroy ⇒ Object
DELETE /gamification/items/1.
-
#edit ⇒ Object
GET /gamification/items/1/edit.
-
#index ⇒ Object
GET /gamification/items.
-
#new ⇒ Object
GET /gamification/items/new.
-
#show ⇒ Object
GET /gamification/items/1.
-
#update ⇒ Object
PATCH/PUT /gamification/items/1.
Instance Method Details
#create ⇒ Object
POST /gamification/items
24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/gamification/items_controller.rb', line 24 def create :create, @gamification_item @gamification_item = Gamification::Item.new(gamification_item_params) if @gamification_item.save redirect_to @gamification_item, notice: 'Item was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /gamification/items/1
46 47 48 49 |
# File 'app/controllers/gamification/items_controller.rb', line 46 def destroy @gamification_item.destroy redirect_to gamification_items_url, notice: 'Item was successfully destroyed.' end |
#edit ⇒ Object
GET /gamification/items/1/edit
20 21 |
# File 'app/controllers/gamification/items_controller.rb', line 20 def edit end |
#index ⇒ Object
GET /gamification/items
6 7 8 |
# File 'app/controllers/gamification/items_controller.rb', line 6 def index @gamification_items = Gamification::Item.all end |
#new ⇒ Object
GET /gamification/items/new
15 16 17 |
# File 'app/controllers/gamification/items_controller.rb', line 15 def new @gamification_item = Gamification::Item.new end |
#show ⇒ Object
GET /gamification/items/1
11 12 |
# File 'app/controllers/gamification/items_controller.rb', line 11 def show end |
#update ⇒ Object
PATCH/PUT /gamification/items/1
37 38 39 40 41 42 43 |
# File 'app/controllers/gamification/items_controller.rb', line 37 def update if @gamification_item.update(gamification_item_params) redirect_to @gamification_item, notice: 'Item was successfully updated.' else render :edit end end |