Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Input with field not in database. Is that possible? #621
I'd like to make an input with a field name not in the database model but I get an undefined method error. Is this possible with some option I can't seem to find?
In the example below, neither t or t2 exists in the model. The rails helper text_field_tag works fine but the simple_form does not. I've tried adding an :as option to give it a hint but no good. I even tried f.input_field but that didn't work either.
= simple_form_for(@mymodel) do |f|
I can build it using rails form helper tags but then I have to manually add the corresponding wrappers to be consistent with the rest of the simple form. Which then is not simple.
The intent of all this is to process the input fields first and then store something different into the model.