For a subscription form, I need to have a field that is not mapped to my User object.
This field is only used to ask the user for an invitation code, that is checked against an invitations list in the create action of the controller, but not saved anywhere, and without a relation to this User object.
I tried :
<%= semantic_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= f.input :invitation_key, :input_html => {:name => 'invitation_key', :id => 'invitation_key'} %>
But it does not work.
What is the correct way to do this with Formtastic ?
You could just do something like this instead of the f.input. I couldn't find a way to do it with a Formtastic-specific helper:
<li>
<%= label_tag 'Invitation Key' %>
<%= text_field_tag :invitation_key %>
</li>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With