routes get matched from top to bottom, if you slightly change the order of
your routes, it should work fine.
Try:
Merb::Router.prepare do
match('/splats/create(.:format)', :method =>"get").to(:controller
=>'splats', :action =>'create')
resources :splats
slice(:merb_auth_slice_password, :name_prefix => nil, :path_prefix => "")
default_routes
end
You had 2 issues, one was that resources :splates was defined before your
custom route and therefore was matching /splats/creates(.:format), :method
=> 'post'
and you had the default routes defined above your custom route. (default
routes should always be the last defined)
- Matt
On Wed, Jul 15, 2009 at 1:17 AM, George <[email protected]>wrote:
>
> Yep, I only have the default_routes entry in the at the moment. Like
> this...
>
> Merb::Router.prepare do
> resources :splats
> slice(:merb_auth_slice_password, :name_prefix => nil, :path_prefix
> => "")
> default_routes
> match('/splats/create(.:format)', :method =>"get").to(:controller =>
> 'splats', :action =>'create')
> end
>
> I'm not sure what .:format does but it works if I POST to the /splats/
> create path but gets a 404 if send data to it using a GET. How do I
> get it to accept a GET with url parameters instead?
>
> BTW if, say, one of the fields is called "data" then I've assumed I
> need to use a post/get param name of "splat[data]" (I copied this
> notation from the html generated in the new and edit html output) Do
> let me know if this is incorrect but it seemed to work for POST. I've
> not found any docs about this so I might blog it when I've figured it
> all out!
>
> Many thanks again,
> George
>
>
> On Jul 15, 3:58 am, Matt Aimonetti <[email protected]> wrote:
> > Could you show the routes you defined before this one?
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---