I thought request.method should return a character like :get :put , etc.? But instead, in the controller action, I get GET as a string!
Am I doing something wrong?
In routes.rb :
resources :posts member do get 'some_action' end end
In the .erb view:
<%= link_to "Some Action",some_action_post_path %>
In PostsController :
def some_action p request.method # => "GET" p request.method.class.name # => "String" if request.method == :get #does not get called end end
Ps. I am using Rails 3.0.3 on Ruby 1.8.7 p330
Zabba
source share