Sha256: 41304bbfc7493ffd592c2ad48d93143714c9055aa2e97ca5fd340b6babc305c1
Contents?: true
Size: 1.29 KB
Versions: 25
Compression:
Stored size: 1.29 KB
Contents
= simple_form_for @role, url: admin_role_create_permissions_path(role), method: :post, remote: true do %label.switch-box{ style: 'padding-top: 5px; padding-right: 40px;' } - if !role.action?(module_name, action) %label.switch %input{ name: 'role[module]', type: 'hidden', value: module_name } %input{ name: 'role[action]', type: 'hidden', value: action } - actions.each do |act| %input{ name: 'role[actions][]', type: 'hidden', value: act } %input{ id: "switch-#{module_name.split('::').join('')}-#{action}", type: 'checkbox' } %span.slider.round{ onclick: "sendPermission('#{module_name}', '#{action}')" } - else %label.switch %input{ name: 'role[module]', type: 'hidden', value: module_name } %input{ name: 'role[action]', type: 'hidden', value: action } - actions.each do |act| %input{ name: 'role[actions][]', type: 'hidden', value: act } %input.active{ id: "switch-#{module_name.split('::').join('')}-#{action}", type: 'checkbox', checked: 'checked' } %span.slider.round{ onclick: "sendPermission('#{module_name}', '#{action}')" } :javascript function sendPermission(module_name, action) { $('#switch-'+module_name.split('::').join('')+'-'+action).parent().parent().parent().submit() }
Version data entries
25 entries across 24 versions & 1 rubygems