-
Notifications
You must be signed in to change notification settings - Fork 630
-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
making attr_readonly fields disabled #877
Comments
I don't think we need any more magic or any more reasons to use the quick form syntax :) In projects where I've needed a disabled field (I use them quite a lot, actually), I implemented a |
I'm all against magic, but whole f.input :foo syntax seems to be about magic and not telling it, what it can already get from the model. Without this, there's redundancy between model and view where you do this like you said or something like f.input :name, input_html: {disabled: f.object.persisted?} that I have. Without this behavior seems a bit unnatural, you have a normal form, you submit it, and data is not updated. Why letting user edit something that cannot be updated? Sorry that I keep asking, I very much respect your decision since all previous ones lead to very nicely designed library, please just think about it some more when you have a sec. |
@comboy agreed, there's plenty of magic, my argument is that I'm not really interested in more magic without a seriously strong rationale. I'll be removing magic in upcoming versions :) I just can't see this being a major pain point for the average developer. Can you get specific about your use case? |
@justinfrench Yes I guess most people just don't display these readonly fields in edit form. My use case is mostly through activeadmin. Thanks for taking time to explain and good luck fighting magic :) |
Hi,
What do you think about making fields listed as attr_readonly disabled in edit form by default? I'd gladly try to contribute this, I just wanted to check if it's indeed a good idea.
The text was updated successfully, but these errors were encountered: