Class: Admin::SuggestionsController
- Inherits:
-
AdminCartoonistController
- Object
- AdminCartoonistController
- Admin::SuggestionsController
- Defined in:
- app/controllers/admin/suggestions_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
2 3 4 |
# File 'app/controllers/admin/suggestions_controller.rb', line 2 def index @suggestions = Suggestion.shown.reverse_chronological end |
#show ⇒ Object
16 17 18 |
# File 'app/controllers/admin/suggestions_controller.rb', line 16 def show @suggestion = Suggestion.find params[:id].to_i end |
#toggle ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/admin/suggestions_controller.rb', line 6 def toggle Suggestion.toggle! params if params[:id].present? redirect_to "/admin/suggestions/#{params[:id]}" else redirect_to "/admin/suggestions" end end |