Add a way to disabled/read-only a field in forms.
Sometimes we have a behavior where we want to disable or hide a particular field in form.
For instance I don't want to allow user to edit certain fields in the form, with current behavior I have to write a custom field or have a conditional handling to manage such a behavior.
is that good ideal to passing the html options through Field options?
Unfortunately, at the moment there isn't a way to hide/show form fields depending on dynamic conditions.
@pragatiwagh is this meet your requirment? https://github.com/thoughtbot/administrate/pull/1991
@jubilee2 With #1991 we can restrict what fields to be included in edit/update. What i want to achieve is have a field in edit form too but as read-only. So it user knows what it is but cannot edit it. I think this would be common behavior for many applications and would be really helpful if we could something like this with simple configuration.
Understand I have this need also
https://github.com/jubilee2/administrate/commit/99f10e3317d83bac815dadf45d1e71e4091ea51b
@pablobm is this good ideal?
if think this way is good then i can create a mr but for document i am limited to do write too much,
Perhaps I didn't understand correctly. Do you want this field to be disabled for every user, or only for certain users?
If it is for every user, you could do it with a custom field instead of changing an existing one. This custom field would not have a form field in it, or it would have a form field with the disabled attribute.
However, if you want that different users can see this field differently (enabled or disabled) then that's more problematic, as Administrate doesn't support this at the moment.
I think this is a duplicate of https://github.com/thoughtbot/administrate/issues/1862, so I'm closing it in favour of the former.