I am not sure if this is correct approach but you could apply the
before filter that could check if given post belongs to given topic
(and the topic belongs to given forum :) )

On Oct 13, 11:32 am, Rock Roll <[EMAIL PROTECTED]>
wrote:
> Hi. I have a problem in restful routing. My project is a discussion
> forum.
>
> The route is
>
> map.resources :forums do |forum|
>       forum.resources :topics do |topic|
>              topic.resources :posts
>       end
> end
>
> Everything in the code I wrote are working good.
>
> An example url for a show action of a forum post would be
>
> http://localhost:3000/forums/3/topics/4/posts/90
>
> Now if i replace 90 by 200, I get the post with id 200 which doesn't
> belong to topic id 4.
>
> How can i prevent this?
>
> Thank you
> --
> Posted viahttp://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
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