I would think that the find code in your PostsController is something like

@post = Post.find(params[:id])

This of course directly gets the Post with the id specified in the URL.

What you can do to get around it is to drilldown from the Forum, Topic
and then Post.  Something like this:

@forum = Forum.find(params[:forum_id], :include => { :topics => :posts } )
@topic = @forum.topics.select { |topic| topic.id ==
params[:topic_id].to_i }.first
@post = @topic.posts.select { |post| post.id == params[:id].to_i }.first

Please note that the code above is not robust as it does not check for nils.
If @topic were nil for example, the last line to get the post will bomb out.

/franz

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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