On my website a user can upload "inspirations" aka images or text that a user finds inspirational.
I want to create a feature, like Pinterest, where a user can click on a image or text to "pin it" instead of having to upload his own.
Upon clicking the button I want the user to be redirected to inspirations/_form with the appropriate fields populated.
For example, I tried passing it in the path with new_inspiration_path({image: inspiration.image})
, but that didn't have an effect.
<% @inspirations.each do |inspiration| %>
<%= link_to new_inspiration_path, data: { modal: true } do %>
<span class="glyphicon glyphicon-plus"></span>
<% end %>
<%= link_to image_tag(inspiration.image.url(:medium)), inspiration %>
<% end %>