Ruby on Rails
Tuesday, April 25, 2017
Can i add attributes to set in create in addition to whateveer's in params list even if the additional attributes are the only source for attributes which are validated at the model level For me, headline is validated in the model but there's no headline field in the form, it gets created on the fly in the controller using the info from the other fields in the params list as @news_item.headline="whatever" where form is form_for(@news_item) and there's not going to be params[:news_item] sent to the controller
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0e8829c1-599f-40eb-af52-dcff553c0680%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment