title: Pre-fill form field with data from prior page in Rails
body: <p>I recently added <code>Mailboxer</code> to my Rails app and have everything working well.</p>
  
  <p>However, I want to be able to create a new message by clicking a "Message Me" button on a User's page and then have the recipient filled in already (with the User from the prior page) when the form for creating the message loads.</p>
  
  <p>The particular field in question:</p>
  
  <pre><code>&lt;%= select_tag 'recipients', recipients_options, multiple: true, class: 'new_message_recipients_field' %&gt;
  </code></pre>
  
  <p>And for reference, <code>recipients_options</code> probably won't come into play in this scenario, but it is the list of all Users--which I use primarily when I'm creating a Message from anywhere but a User page--and is defined in my Messages helper</p>
  
  <pre><code>def recipients_options
    s = ''
    User.all.each do |user|
      s &lt;&lt; "&lt;option value='#{user.id}'&gt;#{user.first_name} #{user.last_name}&lt;/option&gt;"
    end
    s.html_safe
  end
  </code></pre>
  
  <p>And my <code>messages_controller.rb</code>:</p>
  
  <pre><code>def new
  end
  
  def create
    recipients = User.where(id: params['recipients'])
    conversation = current_user.send_message(recipients, params[:message][:body], params[:message][:subject]).conversation
    flash[:success] = "Message has been sent!"
    redirect_to conversation_path(conversation)
  end
  </code></pre>
  
  <p>I already have the link to the New Message form on each User page...</p>
  
  <p><code>&lt;%= link_to 'Message me', new_message_path %&gt;</code></p>
  
  <p>But I don't know how to pre-fill the recipient in the subsequent form.</p>
  
  <p>Any suggestions for how would I go about this?</p>