title: How can I pull data in a controller and form for one model that is in a different model with out a foreign key relationship?
body: <p>I am new to rails and haven't really done to much with data outside of the model.
  I have a form that references a table controller for files.  I want to add an dropdown that will display a list of projects from a project table for the user to assign a the file to a project if they want too.  Assigning a project is not a requirement.  The file can be unassigned to a project.  I do have a project_id column in the file table for those projects assigned but it is allowed to be null and I did not build a relationship because I need to have cases where there are none.</p>
  
  <p>Can someone please tell me how to do this?</p>
  
  <p>When they evaluate the file, the screen posts back with a save or update button depending if it has already been saved in the database.  </p>
  
  <p>At the same time as the save and update pop up on the right I want to display a list box of the projects with an assign project button.   If new just a list, if update either just a list because not assigned or display the selected value in the list if already assigned, while allowing them to change it from the list if desired.</p>
  
  <p>In the file controller method that posts back to the UI I have this code:</p>
  
  <pre><code>@file_alias_filedata = FileAliasFiledata.all
  @projects = Project.all
  </code></pre>
  
  <p>for update</p>
  
  <pre><code>@projects = Project.find(params[:id]) 
  </code></pre>
  
  <p>In the form I have this code:</p>
  
  <pre><code>&lt;p&gt; &lt;label&gt; Select Project to Assign:&lt;/label&gt;  &lt;br /&gt;
   &lt;%= select_tag 'projects', (@projects.present? ? options_for_select(@projects, @selected_project) : []) %&gt; &lt;/p&gt; 
  </code></pre>
  
  <p>The form runs but I get this in the dropdown box:</p>
  
  <pre><code>#&lt;Project:0x))7ff531ab4518&gt;
  </code></pre>
  
  <p>Can someone please help me figure out how to accomplish my task and why I see the strange box value?
  What am I doing wrong?</p>
  
  <p>Thank you for your help!</p>