-
Notifications
You must be signed in to change notification settings - Fork 35
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
Assign form attributes #8
Comments
You're correct. The functionality you describe is the desired. I'll work on it. |
Actually I think how it works currently is the desired way. Library users are expected to use strong parameters. |
@kaspth Why to use strong parameters if you are using form objects? We already list all allowed attributes in |
👍 I agree with the comment above |
I don't mind the duplication concern expressed here as I'm not DRY religious (not saying you are). To me it feels odd that a form specifies its accepted attributes. Rails moved away from On the other hand, specifying What do you think, @m-Peter? |
I concerned about duplication not because DRY, but because keeping in sync many attributes between form and controller bored. |
I share the same opinion with @andrey-skat . I had a hard time trying to setup the nested hierarchy nature that |
There is a WIP in this commit: 8e847e7 . Let me know your thoughts about it. |
@andrey-skat I know they functionally aren't the same, but effectively they are for what we're talking about. @m-Peter I've left some comments for you on that linked commit. |
@kaspth Thanks for your help! I've applied them and will update the commit. |
I have form:
Then in a controller I submit params:
But if params contain not
name
key (example:foo
) I have error:NoMethodError: undefined method
foo=' for #Forms::Publishers::CreateForm:0x007f85805f70a0. It force my to use
params.slice(...)or
strong_parameters` gem. Why not just ignore attributes which don't defined? I thought form should receive any params but assign only defined?The text was updated successfully, but these errors were encountered: