Sha256: 834439bddb7b4f0233e1084ffe422e6c20b8a1f751db929b6849d92e54bdedf6

Contents?: true

Size: 661 Bytes

Versions: 23

Compression:

Stored size: 661 Bytes

Contents

module HydraEditor
  module Form
    module Permissions
      extend ActiveSupport::Concern

      module ClassMethods
        def build_permitted_params
          permitted = super
          permitted << { permissions_attributes: [:type, :name, :access, :id, :_destroy] }
          permitted
        end
      end

      # This is required so that fields_for will draw a nested form.
      # See ActionView::Helpers#nested_attributes_association?
      #   https://github.com/rails/rails/blob/a04c0619617118433db6e01b67d5d082eaaa0189/actionview/lib/action_view/helpers/form_helper.rb#L1890
      delegate :permissions_attributes=, to: :model
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
hydra-editor-3.1.0 app/forms/hydra_editor/form/permissions.rb
hydra-editor-3.0.0.beta1 app/forms/hydra_editor/form/permissions.rb
hydra-editor-2.0.0 app/forms/hydra_editor/form/permissions.rb