This project is archived and is in readonly mode.

#6371 ✓invalid
ydt

request.post? doesn't work

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

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 %>

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages