The recommended way of dealing with long lines is to move them into a
helper. This makes your views much easier to read, and encourages you to
abstract out repetitive calls.

If that's absolutely unworkable, you can use the pipe character to write
multiline calls in Haml. You have the syntax wrong: you need to put a pipe
character after every line that you want to merge into one line, like so:

  = observe_field :lookup_field, |
    :url => { :controller => :some_controller, :action => :lookup }, |
    :update => :destination, |
    :with => "seed" |

- Nathan

On 10/31/07, vld <[EMAIL PROTECTED]> wrote:
>
>
> Truth to be told, Rails uses colon notation very heavily. E.g. here:
> http://api.rubyonrails.com/classes/ActiveRecord/Base.html#M001086
>
> Creating a helper for each occurrence of a long line call is not a
> practically working solution.
>
> I would perceive the issue being a bug, because HAML should not treat
> lines following the "|" symbol as new parseable lines at all - so the
> problem should not occur ever.
>
> Thank you for the suggestion.
>
> On Oct 31, 12:27 pm, "s.ross" <[EMAIL PROTECTED]> wrote:
> > One possible way to do this is to write a helper that returns a hash.
> >
> > def observe_helper
> >    {:url => {:controller => 'some_controller', :action =>
> > 'lookup'}, :update => 'destination', :with => 'seed'}
> > end
> >
> > In your haml:
> >
> > = observe_field :lookup_field, observe_helper
> >
> > Or something like that. Would it work?
> >
> > BTW: I was under the impression that, for whatever reason, Rails
> > didn't appreciate symbols as the value elements of their hashes.
> >
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to