title: Calling custom action without re-rendering page with Rails link_to
body: <p>In _follow.html.slim I am trying to make a link to "Add Friend"  with this:</p>
  
  <pre><code>= link_to "Add Friend",  :controller =&gt; "relationships", :action =&gt; "req"
  </code></pre>
  
  <p>I want it to call the method req in the relationships controller while staying on the same page.  It currently isn't even calling the method and is returning this error: 
  No route matches {:controller=>"relationships", :action=>"req", :name=>"Nathan Glass", :age=>"21"}</p>
  
  <p>I'm following this tutorial <a href="http://francik.name/rails2010/week10.html" rel="nofollow">http://francik.name/rails2010/week10.html</a> and he doesn't define a route for this action.  If this error is correct I guess my confusion is why I need a route for this. Otherwise, what is my problem here?  Thanks!</p>
  
  <pre><code>class RelationshipsController &lt; ApplicationController
  def req
      puts "req called"*10
      # is setting @current_user since the current_user method already returns @current_user?
      @current_user = current_user
      @friend = User.find_by_name(params[:name])
      unless @friend.nil?
          if Relationship.request(@current_user, @friend)
            flash[:notice] = "Friendship with #{@friend.name} requested"
          else
              flash[:error] = "Friendship with #{@friend.name} cannot be requested"
          end
      end
    # render somewhere
  end
  </code></pre>
  
  <p>end</p>