Class: Smithy::SettingsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Smithy::SettingsController
- Defined in:
- app/controllers/smithy/settings_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
22 23 24 25 26 27 |
# File 'app/controllers/smithy/settings_controller.rb', line 22 def create @setting = Setting.new(filtered_params) @setting.save flash.notice = "Your setting was created" if @setting.persisted? respond_with @setting end |
#destroy ⇒ Object
40 41 42 43 44 |
# File 'app/controllers/smithy/settings_controller.rb', line 40 def destroy @setting = Setting.find(params[:id]) @setting.destroy respond_with @setting end |
#edit ⇒ Object
29 30 31 32 |
# File 'app/controllers/smithy/settings_controller.rb', line 29 def edit @setting = Setting.find(params[:id]) respond_with @setting end |
#index ⇒ Object
7 8 9 10 |
# File 'app/controllers/smithy/settings_controller.rb', line 7 def index @settings = Setting.all respond_with @settings end |
#new ⇒ Object
17 18 19 20 |
# File 'app/controllers/smithy/settings_controller.rb', line 17 def new @setting = Setting.new(filtered_params) respond_with @setting end |
#show ⇒ Object
12 13 14 15 |
# File 'app/controllers/smithy/settings_controller.rb', line 12 def show @setting = Setting.find(params[:id]) respond_with @setting end |
#update ⇒ Object
34 35 36 37 38 |
# File 'app/controllers/smithy/settings_controller.rb', line 34 def update @setting = Setting.find(params[:id]) flash.notice = "Your setting was saved" if @setting.update_attributes(filtered_params) respond_with @setting end |