Class: Selections::SelectionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Selections::SelectionsController
- Defined in:
- app/controllers/selections/selections_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
19 20 21 22 23 24 25 26 |
# File 'app/controllers/selections/selections_controller.rb', line 19 def create @selection = Selection.new(params[:selection]) if @selection.save redirect_to @selection, notice: 'Selection was successfully created.' else render action: "new" end end |
#destroy ⇒ Object
38 39 40 41 42 43 |
# File 'app/controllers/selections/selections_controller.rb', line 38 def destroy @selection = Selection.find(params[:id]) @selection.destroy redirect_to selections_url end |
#edit ⇒ Object
15 16 17 |
# File 'app/controllers/selections/selections_controller.rb', line 15 def edit @selection = Selection.find(params[:id]) end |
#index ⇒ Object
3 4 5 |
# File 'app/controllers/selections/selections_controller.rb', line 3 def index @selections = Selection.all end |
#new ⇒ Object
11 12 13 |
# File 'app/controllers/selections/selections_controller.rb', line 11 def new @selection = Selection.new end |
#show ⇒ Object
7 8 9 |
# File 'app/controllers/selections/selections_controller.rb', line 7 def show @selection = Selection.find(params[:id]) end |
#update ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/selections/selections_controller.rb', line 28 def update @selection = Selection.find(params[:id]) if @selection.update_attributes(params[:selection]) redirect_to @selection, notice: 'Selection was successfully updated.' else render action: "edit" end end |