Note that this breaks the make_friend link in friend notfication
emails, but it will do as a temporary measure.
<%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => contact.display_name %>
|
<% if @user.is_friends_with?(contact) %>
<%= link_to t('user.view.send message'), :controller => 'message', :action => 'new', :display_name => contact.display_name %>
|
<% if @user.is_friends_with?(contact) %>
- <%= link_to t('user.view.remove as friend'), :controller => 'user', :action => 'remove_friend', :display_name => contact.display_name, :referer => request.fullpath %>
+ <%= link_to t('user.view.remove as friend'), :controller => 'user', :action => 'remove_friend', :display_name => contact.display_name, :referer => request.fullpath, :method => :post %>
- <%= link_to t('user.view.add as friend'), :controller => 'user', :action => 'make_friend', :display_name => contact.display_name, :referer => request.fullpath %>
+ <%= link_to t('user.view.add as friend'), :controller => 'user', :action => 'make_friend', :display_name => contact.display_name, :referer => request.fullpath, :method => :post %>
<%= link_to t('user.view.comments'), :controller => 'diary_entry', :action => 'comments', :display_name => @this_user.display_name %>
|
<% if @user and @user.is_friends_with?(@this_user) %>
<%= link_to t('user.view.comments'), :controller => 'diary_entry', :action => 'comments', :display_name => @this_user.display_name %>
|
<% if @user and @user.is_friends_with?(@this_user) %>
- <%= link_to t('user.view.remove as friend'), :controller => 'user', :action => 'remove_friend', :display_name => @this_user.display_name %>
+ <%= link_to t('user.view.remove as friend'), :controller => 'user', :action => 'remove_friend', :display_name => @this_user.display_name, :method => :post %>
- <%= link_to t('user.view.add as friend'), :controller => 'user', :action => 'make_friend', :display_name => @this_user.display_name %>
+ <%= link_to t('user.view.add as friend'), :controller => 'user', :action => 'make_friend', :display_name => @this_user.display_name, :method => :post %>
<% end %>
<% if @this_user.blocks.exists? %>
|
<% end %>
<% if @this_user.blocks.exists? %>
|
# user pages
match '/user/:display_name' => 'user#view', :via => :get, :as => "user"
# user pages
match '/user/:display_name' => 'user#view', :via => :get, :as => "user"
- match '/user/:display_name/make_friend' => 'user#make_friend', :via => :get
- match '/user/:display_name/remove_friend' => 'user#remove_friend', :via => :get
+ match '/user/:display_name/make_friend' => 'user#make_friend', :via => :post
+ match '/user/:display_name/remove_friend' => 'user#remove_friend', :via => :post
match '/user/:display_name/account' => 'user#account', :via => [:get, :post]
match '/user/:display_name/set_status' => 'user#set_status', :via => :get, :as => :set_status_user
match '/user/:display_name/delete' => 'user#delete', :via => :get, :as => :delete_user
match '/user/:display_name/account' => 'user#account', :via => [:get, :post]
match '/user/:display_name/set_status' => 'user#set_status', :via => :get, :as => :set_status_user
match '/user/:display_name/delete' => 'user#delete', :via => :get, :as => :delete_user
- { :path => "/user/username/make_friend", :method => :get },
+ { :path => "/user/username/make_friend", :method => :post },
{ :controller => "user", :action => "make_friend", :display_name => "username" }
)
assert_routing(
{ :controller => "user", :action => "make_friend", :display_name => "username" }
)
assert_routing(
- { :path => "/user/username/remove_friend", :method => :get },
+ { :path => "/user/username/remove_friend", :method => :post },
{ :controller => "user", :action => "remove_friend", :display_name => "username" }
)
{ :controller => "user", :action => "remove_friend", :display_name => "username" }
)