title: Favorites showing on all users, not the specific one a user favorites
body: <p>Attempting to make a favorites button, then when clicked will only show favorites for a specific user not show all favorites for all users.  My OnClick is hitting my POST correctly, and on the backend when a user favorites a coffee shop it only shows against their profile not anyone else.  So I think its just the way im attempting to display this information to the user.  I am using React frontend/Rails backend and JWT for Auth.</p>
  <p>My Controller</p>
  <pre><code>class FavoritesController &lt; ApplicationController
      before_action :authorized, only:[:create]
      def index
          favorite = Favorite.find_by(params[:user_id])
          favorites = Favorite.all 
          render json: favorites
      end
  
      def show
          favorite = Favorite.find_by(params[:user_id])
          render json: favorite
      end
  ....
  </code></pre>
  <p>my onClick ...</p>
  <pre><code>....
   &lt;button className=&quot;submit-fav&quot; onClick={(e) =&gt; {this.handleAdd(e)}}&gt;  ♥  &lt;/button&gt;
  ...
  </code></pre>
  <p>my fetch to addToFav and show favs</p>
  <pre><code>addToFav = (cafe) =&gt; {
    console.log(cafe)
    fetch(`http://localhost:3000/favorites`,{
      method: &quot;POST&quot;,
      headers: { 
        &quot;Content-Type&quot; : &quot;application/json&quot;,
        Accept: &quot;application/json&quot;,
        Authorization: `bearer ${localStorage.token}`
      },
        body: JSON.stringify( cafe )
    })
    .then(res =&gt; res.json())
    .then(json =&gt; alert(json.message)
    )}
  ...
  
  
  
   componentDidMount() {
        fetch(`http://localhost:3000/favorites`)
        .then(resp =&gt; resp.json())
        .then(favorites =&gt; this.setState({ favorites }))
      }
  </code></pre>
  <p>My Schema</p>
  <pre><code> enable_extension &quot;plpgsql&quot;
  
    create_table &quot;coffee_shops&quot;, force: :cascade do |t|
      t.string &quot;name&quot;
      t.string &quot;image_url&quot;
      t.string &quot;phone&quot;
      t.datetime &quot;created_at&quot;, precision: 6, null: false
      t.datetime &quot;updated_at&quot;, precision: 6, null: false
    end
  
    create_table &quot;favorites&quot;, force: :cascade do |t|
      t.integer &quot;user_id&quot;
      t.integer &quot;coffee_shop_id&quot;
      t.datetime &quot;created_at&quot;, precision: 6, null: false
      t.datetime &quot;updated_at&quot;, precision: 6, null: false
    end
  
    create_table &quot;reviews&quot;, force: :cascade do |t|
      t.string &quot;reviewed_coffee&quot;
      t.string &quot;coffee_shop_name&quot;
      t.string &quot;user_username&quot;
      t.integer &quot;coffee_shop_id&quot;
      t.integer &quot;user_id&quot;
      t.integer &quot;rating&quot;
      t.datetime &quot;created_at&quot;, precision: 6, null: false
      t.datetime &quot;updated_at&quot;, precision: 6, null: false
    end
  
    create_table &quot;users&quot;, force: :cascade do |t|
      t.string &quot;city&quot;
      t.string &quot;img_url&quot;
      t.string &quot;username&quot;
      t.string &quot;password_digest&quot;
      t.datetime &quot;created_at&quot;, precision: 6, null: false
      t.datetime &quot;updated_at&quot;, precision: 6, null: false
    end
  
  end
  </code></pre>
  <p>Any more info needed let me know!</p>
  <p>any advise appreciated!</p>