ruby on rails - Passing params from one model to another -
i'm trying pass params 1 model when creating other model.
for example, when listing out users each user has link create new post:
<%= link_to "create", new_post_path %> when link clicked , redirected new_post_path want able display name user value in name input field.
<%= form_for @post method: "post" |p| %> <%= p.label :post_name %> <%= p.text_field :post_name, :value => #user name here# %> <%= p.submit "create" %> <% end %> ideas???
Comments
Post a Comment