Brian,

You are running into Rails/RESTful convention.  In those conventions, the
new action is a GET that returns the form for a new object.  The create action
expects a POST with the data for the new object.  If this is not the semantics
of your app or controller, either don't use 'map.resources' which does conform
to the Rails/RESTful way, or change your actions and routes.

So what does your 'new' action do?

Jeffrey


Quoting brianp <[email protected]>:
> Hey Jeffery,
> 
> thanks for the quick reply.
> 
> I had a good feeling it was trying to make a post request.
> 
> I did try changing the :method => :post but this actually chokes the
> method altogether. I get no response at all.
> 
> And the other option for changing my routing I'm not sure I know how
> to do.
> 
> My manage related routes are currently:
>  map.resources :manage
>  map.resources :manage, :collection => { :available => :get }
> 
> How would I go about forcing :new to be :post ?
> 
> i tried something like:
> map.resources :manage, :collection => { :new => :post } but this caues
> the sever now to run.
> 
> On Nov 26, 12:57 am, "Jeffrey L. Taylor" <[email protected]>
> wrote:
> > Quoting brianp <[email protected]>:
> >
> > > Hey everyone,
> >
> > > I'm using the Ajax tabs method/example seen 
> > > at:http://actsasflinn.com/Ajax_Tabs/index.html
> >
> > > It renders partials without a problem but when I need it to render
> > > from :controller => 'manage', :action => 'new' I receive:
> >
> > > ActionController::MethodNotAllowed
> > > Only get, put, and delete requests are allowed.
> >
> > The AJAX code is making a POST request.  Change the routing to allow POSTs 
> > or
> > change the template or RJS to make a GET request (probably add ':method =>
> > :get') to parameter list.  If the action does not alter the state, use the
> > former, otherwise use the latter.  E.g., is it okay if a search engine 
> > spider
> > invokes the 'new' action?  From the name, I'd guess not.  So change the
> > routing to allow or even require POST requests.
> >
> > HTH,
> >   Jeffrey
> 
> --
> 
> 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 [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to