This project is archived and is in readonly mode.
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
-
ydt February 4th, 2011 @ 10:31 AM
Error, it's my fault, it is a PUT request, but request.method is contain POST...
-
Santiago Pastorino February 4th, 2011 @ 01:30 PM
- State changed from new to invalid
- Importance changed from to Low
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>