Hello,

I understand that it is deliberately annoying to make multi-line code
in HAML, and the philosophy behind it.

However, I keep running into what I believe is a valid exception to
this philosophy: specifying a data structure with the sole purpose of
driving the UI.

I have a few fairly clean HAML templates that iterate over a data
structure to build out a page. The problem is that the data
structures' entire purposes are to spell out how to build the UI. I
currently define them into class variables in the controllers so that
I can use the cleaner standard ruby syntax to break it out over
multiple lines.

The problem is, they really belong *in* the view templates - that is
the only place the are consumed. It hinders maintainability to have to
run around looking for the definition of a static value that is only
used in one place.

I could put them in the controller, but they aren't used there, and
they overwhelm it, making simple controllers very hard to read. I
could create a helper to define it and then set it in the controller
via the helper - but now you have to go to two different places to
suss out the content of a static variable that is only used once in
one place.

Is there another way? If you are simply defining a static ruby
variable, is there an exception to the multi-line syntax that is *not*
deliberately hard to use?

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