[eluser]johnmerlino[/eluser]
Hey all,
Rails supports collection and member routes. For example, you may have a dashboard which you call homes controller. This homes controller has a collection of posts so you logically want to access the url like this to get the collection of posts:
homes/posts
But each post can have one or many images, so you access the url like this now to access the filter of images that belong to that post:
homes/posts/1/image
In order to be able to click the link on home page (homes/index) and be nagivated to homes/posts/1/image page, you create this in your routes in Rails:
resources :homes do
collection do
get 'posts'
end
end
resources :posts do
member do
get 'image'
end
end
I want to click on a link on my homes page and be able to navigate to create_image page:
homes/posts/1/create_image
So when I upload the image, I know to which post it belongs to (in this case post 1).
I look at the routing section of codeigniter user documentation and it really doesn't address this occurrence. It just says you can use (:num) to refer to any page number and regular expressions.
Any idea how to get the effect I want with routes in codeigniter?
Thanks for response.