diff --git a/lib/madmin/field.rb b/lib/madmin/field.rb index f0d7ba70..37b5f628 100644 --- a/lib/madmin/field.rb +++ b/lib/madmin/field.rb @@ -36,7 +36,7 @@ def visible?(action) case action when :index default_index_attributes.include?(attribute_name) - when :new, :edit + when :new, :create, :edit, :update # Hidden attributes for forms [:id, :created_at, :updated_at].exclude?(attribute_name) else diff --git a/lib/madmin/resource.rb b/lib/madmin/resource.rb index dafd8f81..8b206539 100644 --- a/lib/madmin/resource.rb +++ b/lib/madmin/resource.rb @@ -50,7 +50,9 @@ def attribute(name, type = nil, **options) if config.has_key?(:form) value = config.delete(:form) config.new = value + config.create = value config.edit = value + config.update = value end attributes[name] = OpenStruct.new(