Routing error in Rails 3

I’m hoping someone can advise me on how to debug this routing error.

My routes.rb includes:
resources :prospects, :only => [“create”]

rake routes shows:
prospects POST /prospects(.:format)
{:controller=>“prospects”, :action=>“create”}

However when I try to post a form I get:

Started POST “/prospects” for 127.0.0.1 at 2010-03-20 01:44:29

ActionController::RoutingError (No route matches “/prospects”):

Rendered /Users/ryan/.rvm/gems/ruby-1.9.1-p378/gems/
actionpack-3.0.0.beta/lib/action_dispatch/middleware/templates/rescues/
routing_error.erb within /Users/ryan/.rvm/gems/ruby-1.9.1-p378/gems/
actionpack-3.0.0.beta/lib/action_dispatch/middleware/templates/rescues/
layout.erb (0.9ms)

Any ideas?

On Sat, Mar 20, 2010 at 1:52 AM, rjunee [email protected] wrote:

Any ideas?

Hi, how are you trying to post the form?

-Conrad

I use:

<% form_for @prospect do |f| %>

which generates:

Cheers,
Ryan

Turns out this was caused because my controller was singular
(ProspectController) instead of plural (ProspectsController).

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs