Class: Rankit::RankablesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Rankit::RankablesController
- Defined in:
- app/controllers/rankit/rankables_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/controllers/rankit/rankables_controller.rb', line 16 def create @rankable = Rankable.new(rankable_params) @rankable.creator = current_user if @rankable.save redirect_to(rankit.rankables_path) end end |
#destroy ⇒ Object
34 35 36 37 |
# File 'app/controllers/rankit/rankables_controller.rb', line 34 def destroy @rankable.destroy redirect_to rankit.rankables_path, :notice => 'Rankable was deleted succesfully' end |
#edit ⇒ Object
24 25 |
# File 'app/controllers/rankit/rankables_controller.rb', line 24 def edit end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/rankit/rankables_controller.rb', line 8 def index @rankables = Rankable.all end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/rankit/rankables_controller.rb', line 12 def new @rankable = Rankable.new end |
#update ⇒ Object
27 28 29 30 31 32 |
# File 'app/controllers/rankit/rankables_controller.rb', line 27 def update @rankable.update_attributes rankable_params if @rankable.save redirect_to rankit.rankables_path, :notice => 'Rankable was updated succesfully' end end |