Kyle Decot
Kyle Decot

Reputation: 20815

Rails Routing Question

I am creating an API similar to that of Flickr's and I am having some problems with on of the routes. I need something the following to all be routed to the same controller/action:

Upvotes: 0

Views: 65

Answers (1)

GrahamJRoy
GrahamJRoy

Reputation: 1643

if you're trying to pass photos, comments etc as variables then

match 'services/api/:photos/:comments' => 'controller#method'

but I'm not sure what you're quite trying to do. It would seem to make more sense, assuming you are passing these as values, to put the getList and search as separate methods

match 'services/api/getList/:photos/:comments' => 'controller#getList'
match 'services/api/search/:photos/:comments' => 'controller#search'

Upvotes: 2

Related Questions