title: Pass an object id to rails mailer view when object is updated
body: <p>Im trying to send email notifications to followers of a business when the business updates a post. This is the setup I have:</p>
  
  <pre><code>def update
    if @post.update(post_params)
      respond_to do |format|
      format.html { redirect_to posts_index_path, notice: "Updated post"
      format.json { render :'shows/show', status: :ok, location: @post }
      update_page_email_followers 
    else
      format.html { render :edit }
      format.json { render json: @post.errors, status: :unprocessable_entity }
      end
    end
  end
  
  def update_page_email_followers
    @followers = Follow.where(business_id: current_business.id)
    @followers.each do |follower|
      ModelMailer.delay.update_post(@user, follower, @post)
    end
  end 
  </code></pre>
  
  <p>This is the mailer method:</p>
  
  <pre><code>def update_post(post follower, business_id)
    @business = Business.find(follower.business_id)
    @post = post
    @user = User.find(follower.user_id)
    mail(:to =&gt; @user.email, :subject =&gt; "#{@business.account.business_name} updated a post")
  end
  </code></pre>
  
  <p>And this is what I have inside the mail view template <code>update_post.html.erb</code>:</p>
  
  <pre><code>&lt;%= @business.account.business_name %&gt; has just updated a post! Please click on &lt;%= link_to "Updated post", "https://www.example.com/sample-#{@post.id}" %&gt; 
  </code></pre>
  
  <p>The mail notification is being sent correctly to all the followers I just cant get the id of the post on the email view from this : <code>&lt;%= link_to "Updated post", "https://www.example.com/sample-#{@post.id}" %&gt;</code>... it comes out as <code>nil</code>. </p>
  
  <p>Any ideas what I might be missing here?</p>