lgs
2008-Oct-11 17:17 UTC
ActionController::MethodNotAllowed: Only get, put, and delete requests are allowed.
Hi all,
I''d need some help with a Subject already appeared here, anyway I
"re-
post" with same title cause reading the old threads didn''t help
me.
I get a tipical restful routes mismatching :
ActionController::MethodNotAllowed: Only get, put, and
delete requests are allowed.
but after several try & errors, I don''t actually understand
what''s
wrong with it, here are salients bits ...
rails -v :
Rails 2.1.1
rake routes :
create_services POST /services/
create
{:action=>"create", :controller=>"services"}
formatted_create_services POST /services/
create.:format
{:action=>"create", :controller=>"services"}
the patrial which get in error ( _delicious.html.erb ):
<% form_for @service.url, create_services_path do |f| %>
<%= f.error_messages %>
<p>
<%= image_tag("/images/sites_icons/delicious.png") -%>
<%= f.hidden_field :url, :value =>
''http://delicious.com/'' %>
<%= f.label :delicious %>
<%= f.text_field :username %>
</p>
<p>
<%= f.submit "Create" %>
</p>
<% end %>
part of my routes file ( config/routes.rb ):
map.resources :services, :collection => { :create
=> :post }
I know should be something stupid, anyway "I''m losing hours"
without
success !
Any suggestion will be very apreciated.
thz in advance
luca
++++++++++++++
Request
Parameters:
{"commit"=>"Create",
"delicious"=>{"url"=>"http://delicious.com/",
"username"=>"lgsicious"},
"authenticity_token"=>"xxxxxxxxxxxxxxx"}
++++++++++++++
Response
Headers:
{"cookie"=>[],
"Cache-Control"=>"no-cache",
"Allow"=>"GET,
PUT,
DELETE"}
+++++++++++++++
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Ramon Miguel M. Tayag
2008-Oct-11 20:01 UTC
Re: ActionController::MethodNotAllowed: Only get, put, and delete requests are allowed.
That happens to me when I edit the routes and forget to restart my server. Ramon Tayag On Sun, Oct 12, 2008 at 1:17 AM, lgs <luca.soave-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi all, > > I''d need some help with a Subject already appeared here, anyway I "re- > post" with same title cause reading the old threads didn''t help me. > > I get a tipical restful routes mismatching : > > ActionController::MethodNotAllowed: Only get, put, and > delete requests are allowed. > > but after several try & errors, I don''t actually understand what''s > wrong with it, here are salients bits ... > > rails -v : > Rails 2.1.1 > > rake routes : > > create_services POST /services/ > create > {:action=>"create", :controller=>"services"} > formatted_create_services POST /services/ > create.:format > {:action=>"create", :controller=>"services"} > > the patrial which get in error ( _delicious.html.erb ): > > <% form_for @service.url, create_services_path do |f| %> > <%= f.error_messages %> > <p> > <%= image_tag("/images/sites_icons/delicious.png") -%> > <%= f.hidden_field :url, :value => ''http://delicious.com/'' %> > <%= f.label :delicious %> > <%= f.text_field :username %> > </p> > <p> > <%= f.submit "Create" %> > </p> > <% end %> > > part of my routes file ( config/routes.rb ): > > map.resources :services, :collection => { :create > => :post } > > I know should be something stupid, anyway "I''m losing hours" without > success ! > Any suggestion will be very apreciated. > > thz in advance > luca > ++++++++++++++ > Request > > Parameters: > > {"commit"=>"Create", > "delicious"=>{"url"=>"http://delicious.com/", > "username"=>"lgsicious"}, > "authenticity_token"=>"xxxxxxxxxxxxxxx"} > ++++++++++++++ > Response > > Headers: > > {"cookie"=>[], > "Cache-Control"=>"no-cache", > "Allow"=>"GET, > PUT, > DELETE"} > +++++++++++++++ > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---