title: Implement "Add to favorites" in Rails 3 & 4
body: <p>I am building an app where users can create recipes, see all recipes created, view their own recipes in a member area and finally i would like for users to add "favorites" to their account.</p>
  
  <p>I am new to Rails but have read through docs and this is my understanding of what it should look like in the backend. Could someone confirm that this looks correct or advise of any errors please, with explanations if I have done something wrong (which is probably the case)?</p>
  
  <p>So this is my code:</p>
  
  <p>User Model</p>
  
  <pre><code>has_many :recipes
  has_many_favorites, :through =&gt; :recipes
  </code></pre>
  
  <p>Recipe Model</p>
  
  <pre><code>belongs_to :user
  has_many :ingredients #created seperate db for ingredients
  has_many :prepererations #created seperate db for prep steps
  </code></pre>
  
  <p>Favorite Model</p>
  
  <pre><code>belongs_to :user
  has_many :recipes, :through =&gt; :user
  #this model has one column for the FK, :user_id
  </code></pre>
  
  <p>Favorites Controller</p>
  
  <pre><code>def create
    @favrecipes =current_user.favorites.create(params[:user_id])
  end
  </code></pre>
  
  <p>I then wanted to have a button to post to the db, so I have this:</p>
  
  <pre><code>&lt;%= button_to("Add to Favorites" :action =&gt; "create", :controller =&gt; "favorites" %&gt;
  </code></pre>
  
  <p>I think I am probably missing something in my routes but I am unsure.</p>