Yep, you can use the pipe operator ( | )
- form_remote_tag :url => { :action => 'some_action', |
:controller => 'some_controller', :id => item_id }, |
:loading => "Toggle.display('someDiv');", |
:complete => "Toggle.display('someDiv')" do |
You will need the pipe on all lines, including the last one. It's a
non-ideal solution, so you'll probably want to move that into a
helper, which I've found this haml limitation encourages you to do and
is actually a positive benefit.
def create_action_form(&block)
form_remote_tag :url => {
:action => 'some_action',
:controller => 'some_controller',
:id => item_id }, :loading =>
"Toggle.display('someDiv');", :complete =>
"Toggle.display('someDiv')", &block
end
Then you can use it as such...
- create_action_form do
Much cleaner that way
-Jacques
railsjedi.com
On Apr 16, 2008, at 1:34 PM, Matt Grande wrote:
>
> Hi all,
>
> I'm trying to see if there's a cleaner way to do the following in
> HAML.
>
> If I were to write this in RHTML, I would enter the following:
> <% form_remote_tag
> :url => {
> :action => 'some_action',
> :controller => 'some_controller',
> :id => item_id },
> :loading => "Toggle.display('someDiv');",
> :complete => "Toggle.display('someDiv')" do %>
>
> But the only way (I know of to do it in HAML would be to put it all on
> one line:
> - form_remote_tag :url => { :action => 'some_action', :controller =>
> 'some_controller', :id => item_id }, :loading =>
> "Toggle.display('someDiv');", :complete => "Toggle.display('someDiv')"
> do
>
> which I think looks crowded.
>
> Is there a way to split it across a few lines?
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---