Rails Friendship custom actions

Based on the following tutorial ruby - How to Implement a Friendship Model in Rails 3 for a Social Networking Application? - Stack Overflow. I am wondering how should i create the action controllers.

In my friendship tutorial i have the following actions

  def accept   end   def decline   end   def cancel   end   def delete   end   def index   end   def create   end I can call create has follow <%= link_to "Add Friend", friendships_path(:friend_id => customer), :method => :post %> but how can call the following others accepts, decline, and cancel.

Do i need to add the following in my route

  resources :friendships do     get 'cancel'     get 'accept'     get 'decline'   end And call has follow:

<%= link_to "Add Friend", friendships_path(:friend_id => customer), :method => :post %>

Because i get the following error

Routing Error No route matches {:action=>"cancel", :controller=>"friendships"}

Based on the following tutorial ruby - How to Implement a Friendship Model in Rails 3 for a Social Networking Application? - Stack Overflow. I am wondering how should i create the action controllers.

In my friendship tutorial i have the following actions

  def accept   end   def decline   end   def cancel   end   def delete   end   def index   end   def create   end I can call create has follow <%= link_to "Add Friend", friendships_path(:friend_id => customer), :method => :post %> but how can call the following others accepts, decline, and cancel.

Do i need to add the following in my route

  resources :friendships do     get 'cancel'     get 'accept'     get 'decline'   end And call has follow:

<%= link_to "Add Friend", friendships_path(:friend_id => customer), :method => :post %>

Because i get the following error

Routing Error No route matches {:action=>"cancel", :controller=>"friendships"}

If you run rake routes it will show you all the routes you have defined. Also consider what in   get 'cancel' the 'get' means.

Colin