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

Craig Webster craig at xeriom.net
Mon Nov 5 06:18:46 PST 2007


On 5 Nov 2007, at 14:04, Anthony Green wrote:
> I had a brief glance at this but was concerned it was very naïve  
> about view
> contexts

I guess it depends on how different the view should be. In most cases  
I'd say a book should be marked up the same way whether it's through  
an author or through a publisher.

> "* test for the existence of @user or @forum in the view, and  
> display it
> differently"
>
> don't instill much confidence

Using enclosing_resource_name, enclosing_resource_path,  
enclosing_resource, resource_path etc will handle most if not all of  
my use cases. I'm not sure I'd ever test for @user / @forum - a post  
should show the title, message, date posted, author, comments whether  
it's displayed in a forum or in the users recent posts list.

Cheers,
Craig
--
Craig Webster   | Lead Developer   | skype: craigwebster
Xeriom Networks | t: 0131 208 3800 | w: http://xeriom.net/

   -- Virtual machines, dedicated servers and colocation --

Xeriom Networks Limited.
94/1 Spring Gardens, Abbeyhill, Edinburgh, Scotland.
Registered in England and Wales. Company No. 5961686.

All agreements are made under our standard terms and conditions.  
These can
be found at http://xeriom.net/terms_and_conditions





More information about the Chat mailing list