I have a form that allows users to manually input movies to review. Additionally, I am pulling movies from an external API (TMDB). When the user searches, it shows all results from the database as well as another area where data is pulled from the API. I want them to be able to click on a thumbnail from the external API and pre-populate my "new" form with that data. This code currently goes to the "new" form, but the title and description are not populated like I want them to be (a blank new form is rendered).
<% if @movies_api %>
<div class="row">
<% @movies_api.each do |movie| %>
<% if movie.poster_path %>
<div class="col-sm-6 col-md-3">
<div class="thumbnail">
<%= link_to(image_tag('https://image.tmdb.org/t/p/w396' + movie.poster_path, class: 'image', size:"400x600"), {:action => 'new', :controller => 'movies'}, :title => movie.title, :description => movie.overview ) if movie.poster_path %>
</div>
</div>
<% end %>
<% end %>
<% end %>
How do I accomplish pre-populating the new form with data I gather from the API?