Class: Gamification::LevelsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Gamification::LevelsController
- Defined in:
- app/controllers/gamification/levels_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /levels.
-
#destroy ⇒ Object
DELETE /levels/1.
-
#edit ⇒ Object
GET /levels/1/edit.
-
#index ⇒ Object
GET /levels.
-
#new ⇒ Object
GET /levels/new.
-
#show ⇒ Object
GET /levels/1.
-
#update ⇒ Object
PATCH/PUT /levels/1.
Instance Method Details
#create ⇒ Object
POST /levels
26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/gamification/levels_controller.rb', line 26 def create :create, @level @level = Level.new(level_params) if @level.save redirect_to @level, notice: 'Level was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /levels/1
48 49 50 51 |
# File 'app/controllers/gamification/levels_controller.rb', line 48 def destroy @level.destroy redirect_to levels_url, notice: 'Level was successfully destroyed.' end |
#edit ⇒ Object
GET /levels/1/edit
22 23 |
# File 'app/controllers/gamification/levels_controller.rb', line 22 def edit end |
#index ⇒ Object
GET /levels
8 9 10 |
# File 'app/controllers/gamification/levels_controller.rb', line 8 def index @levels = Level.all end |
#new ⇒ Object
GET /levels/new
17 18 19 |
# File 'app/controllers/gamification/levels_controller.rb', line 17 def new @level = Level.new end |
#show ⇒ Object
GET /levels/1
13 14 |
# File 'app/controllers/gamification/levels_controller.rb', line 13 def show end |
#update ⇒ Object
PATCH/PUT /levels/1
39 40 41 42 43 44 45 |
# File 'app/controllers/gamification/levels_controller.rb', line 39 def update if @level.update(level_params) redirect_to @level, notice: 'Level was successfully updated.' else render :edit end end |