Posts Tagged ‘HTTP’

Solution to ActionController::MethodNotAllowed (Only get, put, and delete requests are allowed.)

I was having problems with a nested resource….
route.rb

map.resource :accounts do |account|
account.resources :contacts
end

contacts/new.html.erb

..

I was getting
ActionController::MethodNotAllowed (Only get, put, and delete requests are allowed.)
fun. I tried a lot of things, I googled it, and didn’t quite find the solution….. After a good 30 minutes, the solution appeared below,

account_contacts_path(@account) do |f| %>

Good luck!