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
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| database table row creation method | 1 | 216 | March 8, 2009 | |
| Using Rails form helpers on non-existent methods | 2 | 204 | February 19, 2010 | |
| additional params in controller create action | 2 | 191 | April 26, 2017 | |
| adding data from the model | 1 | 126 | August 5, 2008 | |
| Get model.create(params) to silently skip unknown attributes | 1 | 161 | March 6, 2009 |