I'm building an app, where users can give comments by just leaving their email to the comment.
I want them to be able to register directly from there, by a link with their email adress as a param
(like: <%= link_to register_path(:email => @comment.email %>
) - so there is no existing user record yet.
this should be done by applying a value to the form.input
field via the :value
option.
But the following code doesn't work!
<%- if params[:email] -%>
<%= f.input :email, :required => true, :value => params[:email] %>
<%- else -%>
<%= f.input :email, :required => true %>
<%- end -%>
I had a look inside the formtastic rdoc and inside my local gem but couldn't find any option for that.
Suggestions anyone?