Class: Weeler::SettingsController

Inherits:
ConfigurationController show all
Defined in:
app/controllers/weeler/settings_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



2
3
4
5
# File 'app/controllers/weeler/settings_controller.rb', line 2

def index
  # to get all items for render list
  @settings = Settings.unscoped
end

#updateObject



7
8
9
10
11
12
13
14
15
# File 'app/controllers/weeler/settings_controller.rb', line 7

def update
  @setting = Settings.unscoped.find(params[:id])
  if @setting.update(setting_params)
    redirect_to weeler_settings_path, flash: {success: "Setting updated."}
  else
    flash.now[:error] = "Errors in updating."
    render :index
  end
end