Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

request.post? doesn't work

#6371

On Rails 3.0.3

routes.rb :

resources :albums do
member do

match 'dispatch' => 'albums#dispatch', :via => [:get, :post]

end end

album controller :

def dispatch
logger.info request.post? ? 'yes' : 'no' # Doesn't work logger.info request.method.to_s == 'POST' ? 'yes' : 'no' # Work end

view :

<%= form_for @album, :url => dispatch_album_path(@album) do |f| %>
<%= f.text_field :name %> <%= f.submit %> <% end %>

Reported by ydt · February 4th, 2011 @ 10:18 AM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. ydt
    ydt

    Error, it's my fault, it is a PUT request, but request.method is contain POST...

    February 4th, 2011 @ 10:31 AM

  2. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to invalid
    • Importance changed from to Low

    February 4th, 2011 @ 01:30 PM