Hi I am very new to rails and am having a problem with routing when using polymorphic associations. On I have a link "Add Comment" on the page installations/1/onposts/2 the link then goes to onposts/2/comments, this works and you can add a comment on this page, when you submit it just redirects to stay on the same page. I want to have a link on the comments page to go back to where you came from eg. installations/1/onposts/2, I have no problem generating the onposts/2 part but don't know how to write the path for the link so that the installations is there and further more knows what id to look for.
Any guidance would be greatly appreciated.