[LRUG] Rails Question : Matching Share Nested Resources to Controllers

Tom Stuart tom at experthuman.com
Mon Nov 5 07:16:56 PST 2007


On 5 Nov 2007, at 14:58, Anthony Green wrote:
> I have for example Cancel buttons on a create resource page that can  
> return
> you to 4 different locations depending on what route through the  
> application
> the user took to reach the point where they decide to create the  
> resource.

In this case it again seems to make sense to design a single cancel  
button that understands this logic (which is what? go back to the  
parent resource? the previous page?) rather than trying to choose  
different furniture each time around; you can also get a fair bit of  
mileage out of the new-ish record identification features which let  
you say e.g. url_for @parent_resource and let the routing deal with  
generating the appropriate URL rather than manually calling the named  
route helper yourself.

Cheers,
-Tom



More information about the Chat mailing list