Class: Smithy::SettingsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/smithy/settings_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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

#destroyObject



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

#editObject



29
30
31
32
# File 'app/controllers/smithy/settings_controller.rb', line 29

def edit
  @setting = Setting.find(params[:id])
  respond_with @setting
end

#indexObject



7
8
9
10
# File 'app/controllers/smithy/settings_controller.rb', line 7

def index
  @settings = Setting.all
  respond_with @settings
end

#newObject



17
18
19
20
# File 'app/controllers/smithy/settings_controller.rb', line 17

def new
  @setting = Setting.new(filtered_params)
  respond_with @setting
end

#showObject



12
13
14
15
# File 'app/controllers/smithy/settings_controller.rb', line 12

def show
  @setting = Setting.find(params[:id])
  respond_with @setting
end

#updateObject



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