The primary advantage isn't syntactic. How I see it is that a designer
who knows HAML, but not Ruby could create components out of partials
without having to write any Ruby code. It also adds functionality when
using HAML apart from Rails w/o having to roll your own helpers
framework. This would help to further decouple HAML from Rails and
encourage its use in other environments. There is also a clear
syntactic advantage over:
= render :partial => 'foo'
which would become
$foo
On Oct 23, 12:14 pm, "Chris Eppstein" <[EMAIL PROTECTED]> wrote:
> -1 There's no syntactic advantage here over helpers.
> = calendar(:month => 'January')
>
> = datagrid(:data => @my_hash, :sort_by => 'date', :order => 'asc')
>
> -chris
>
> On Thu, Oct 23, 2008 at 8:05 AM, Lex <[EMAIL PROTECTED]> wrote:
>
> > First off, I just wanted to say Kudos to Hampton Catlin (and everyone
> > else involved) for creating HAML, it's the first templating language
> > that I've actually liked. Super easy to learn too, I'm in looove!
>
> > BUT...
>
> > I think it could be made better...How about this:
>
> > $component{ :localvar => @vartobind }
>
> > Some J**a-based templating systems use this idea (groovy/gsp, and jsf/
> > facelets/jsp) to compose templates out of partials, though they use
> > the xml namespacing method (i.e. <taglib:tag attr="value" />)
>
> > I think this is a great way to make templates more DRY, it allows
> > partials to be extracted, reused, and distributed as components, and
> > it discourages use of inline code in a template. A backing class could
> > be attached to a partial to aid in complex logic.
>
> > Some ideas:
>
> > $calendar{ :month => 'January' }
>
> > $datagrid{ :data => @my_hash, :sort_by => 'date', :order => 'asc' }
>
> > What do you all think?
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" 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/haml?hl=en
-~----------~----~----~----~------~----~------~--~---