Caius, That curious bracket syntax appeared about 2.1 I think; it's incredibly useful, especially when you get into reusing views, and have objects nested in multiple ways....
Does anyone know if that magic syntax has a name, and/or some documentation? - Lee Hambley _ 2009/4/28 Caius Durling <[email protected]> > On 28 Apr 2009, at 20:52, Will Jessop wrote: > > <%= link_to "Permalink", category_joke_path(@joke.category, > @joke), :class => "comments" %> > > > I discovered today you can just do > > <%= link_to "Permalink", [[email protected], @joke], :class => "comments" %> > > > and it'll call `category_joke_path` itself. I'm working on a rails 2.3 app, > not sure when that behaviour was introduced. > > C > --- > Caius Durling > [email protected] > +44 (0) 7960 268 100 > http://caius.name/ > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "NWRUG" 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/nwrug-members?hl=en -~----------~----~----~----~------~----~------~--~---
