<%= form_for(@message) do |f| %>

  <div>
    <% if @send_to != nil %>
      <%= f.label :username %>
      <%= f.text_field :username, :value => User.select("name").where("id = ?",@send_to).map(&:name)[0] %>
    <% else %>
      <%= f.label :username %>
      <%= f.text_field :username %>
    <% end %>
  </div>
  <div>
    <%= f.label :message %>
    <%= f.text_field :message %>
  </div>
  <div>
    <%= f.submit "Send", :class=>"btn btn-large btn-primary" %>
  </div>

<% end  %>