app/models/concerns/cm_admin/cm_role.rb in cm-admin-3.0.14 vs app/models/concerns/cm_admin/cm_role.rb in cm-admin-3.0.15
- old
+ new
@@ -16,11 +16,10 @@
end
cm_show page_title: :name do
custom_action name: 'create_role_permission', route_type: 'member', verb: 'post', path: ':id/create_role_permission',
display_type: :route do
- # allowed_params = params.permit(role_permission: []).to_h
@role = CmRole.find(params[:id])
params[:role_permission].except(:submit).each do |model_name, action_arr|
action_names = action_arr.select { |k, v| k if v.key?('is_checked') }.keys
action_names << 'create' if action_names.include?('new')
action_names << 'update' if action_names.include?('edit')
@@ -35,25 +34,28 @@
@role
end
tab :profile, '' do
cm_show_section 'Role details' do
field :name
+ field :default_redirect_path
field :created_at, field_type: :date, format: '%d %b, %Y'
field :updated_at, field_type: :date, format: '%d %b, %Y'
end
end
tab :permissions, 'permissions', layout_type: 'cm_association_show', partial: '/cm_admin/roles/permissions'
end
cm_new page_title: 'Add Role', page_description: 'Enter all details to add role' do
cm_section 'Details' do
form_field :name, input_type: :string
+ form_field :default_redirect_path, input_type: :string, helper_text: 'Enter a correct path to have default redirect path for this role. Usually it will be /cm_admin/<model name in plural>. Example: /cm_admin/users'
end
end
cm_edit page_title: 'Edit Role', page_description: 'Enter all details to edit role' do
cm_section 'Details' do
form_field :name, input_type: :string
+ form_field :default_redirect_path, input_type: :string, helper_text: 'Enter a correct path to have default redirect path for this role. Usually it will be /cm_admin/<model name in plural>. Example: /cm_admin/users'
end
end
end
end
end