rubyonrailsin

A Ruby and Rails talk

Saturday, March 20, 2010


[Rails] Re: Routing error in Rails 3

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

I use:

<% form_for @prospect do |f| %>

which generates:

<form action="/prospects" class="new_prospect" id="new_prospect"
method="post">


Cheers,
Ryan


On Mar 20, 5:31 am, Conrad Taylor <conra...@gmail.com> wrote:
> On Sat, Mar 20, 2010 at 1:52 AM, rjunee <r...@junee.org> wrote:
> > 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?
>
> Hi, how are you trying to post the form?
>
> -Conrad
>
>
>
> > --
> > 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@googlegroups.com.
> > To unsubscribe from this group, send email to
> > rubyonrails-talk+unsubscribe@googlegroups.com<rubyonrails-talk%2Bunsubscrib e@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive