Re: [Rails] Rails 3 and Friendship models

2010-03-05 Thread Peng Zhong
When I try to add user_3 as a friend using the following code: = link_to 'Add Friend', friendships_path(:friend_id = user), :method = :post #= which generates http://localhost:3000/friendships?friend_id=3 This is what happens in my server console: Started GET /friendships?friend_id=3 for

Re: [Rails] Rails 3 and Friendship models

2010-03-04 Thread Peng Zhong
This is what I have for rake routes. It looks like friendships_path is FriendshipsController#index (like you said), but with :method = :post it should link to FriendshipsController#create? It looks like GET is happening instead of POST. GET/friendships(.:format) {:controller=friendships,

[Rails] Rails 3 and Friendship models

2010-03-03 Thread Peng Zhong
I'm having issues creating Friendships in Rails 3 beta. I'm following Railscast 163 ( http://asciicasts.com/episodes/163-self-referential-association) and this is what I have in the relevant files: *## CONTROLLERS* # application_controller.rb class ApplicationController ActionController::Base