You can define your own filters for haml. It should be fairly
straightforward to define an rjs filter that would DRY up the
%script{:type => 'text/javascript'}
=render :update do |page|
part so you just have:
:rjs
page.visual_effect :shake, 'hello_box'
I can't find any good documentation to point you at... But if you poke
around in the source code, you should see it.
Chris
On Wed, Mar 25, 2009 at 6:50 AM, [email protected] <
[email protected]> wrote:
>
> Hi there
>
> So I've been trying to use inline RJS in haml, it works great, but I
> have an idea for making it a little simpler:
>
> right now if i wanted to use RJS inline I need to do the following:
>
> %script{:type => 'text/javascript'}
> =render :update do |page|
> =page.visual_effect :shake, 'hello_box'
>
> you cant use the :javascript filter because the ruby gets escaped.
>
> So what if a new filter was created that also opened the
> render :update block, so this was possible:
>
> %rjs
> = visual_effect :shake, 'hello_box'
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---