I want to create a route in my rails application line by line
/panda/blog
/tiger/blog
/dog/blog
where panda, tiger and dog are all constant (for the class of animals)
The usual way to do this
map.resources :animals do |animal|
animal.resource :blog
end
will create routes along the lines
/animals/panda/blog
/animals/tiger/blog
/animals/dog/blog
But I do not want the first segment, since it will always be the same.
I know that I can do this using manual routing, but I want to know how to do this using rail resources, because I need animals and blogs.
source
share