Hello,

I would like to have a link_to automatically populate a field in the
form that it is linking to.

For example (excuse my silly words, im trying to make a point)
<%= link_to "Add a COOL Post", new_post_path, :howcoolisit => 'COOL'
%>
<%= link_to "Add a NOTCOOL Post", new_post_path, :howcoolisit =>
'NOTCOOL' %>

Then, I would have a field in that form:

    <%= f.hidden_field :howcoolisit %>

And I would want it to be populated automatically (either NOTCOOL, or
COOL, depending on the link_to that the user has chosen.)

However, it is just being blank.. nothing is getting populated. I must
be missing something, or my approach is wrong.

Does anyone know how to accomplish such a task? Thank you

--David Zhu


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to