mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Refactor admin interface under namespace
This commit is contained in:
parent
0c3105a159
commit
a3b04786cf
7 changed files with 18 additions and 18 deletions
27
app/controllers/admin/setting_groups_controller.rb
Normal file
27
app/controllers/admin/setting_groups_controller.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
class Admin::SettingGroupsController < ApplicationController
|
||||
before_action :set_setting_group, only: [:show, :update]
|
||||
|
||||
def index
|
||||
@setting_groups = SettingGroup.all
|
||||
end
|
||||
|
||||
def show; end
|
||||
|
||||
def update
|
||||
if @setting_group.update(setting_group_params)
|
||||
redirect_to [:admin, @setting_group]
|
||||
else
|
||||
render 'show'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_setting_group
|
||||
@setting_group = SettingGroup.find(params[:id])
|
||||
end
|
||||
|
||||
def setting_group_params
|
||||
params.require(:setting_group).permit(settings_attributes: [:value, :id])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue