HAML vs erb

4 views
Skip to first unread message

Brian Miller

unread,
Jul 27, 2009, 4:40:04 PM7/27/09
to LA Ruby Code Jam
Are we doing HAML or erb for the views? I've been lazy and just doing
erb, but I noticed the views for the pages are done in HAML.

Brian

Ron Evans

unread,
Jul 27, 2009, 4:59:32 PM7/27/09
to laruby-...@googlegroups.com
Yes, so far we have been doing the views in HAML... which is really
quite cool if you have not used it.
--
Ron Evans
310-597-1013
ron....@gmail.com

John Dewey

unread,
Jul 27, 2009, 5:06:50 PM7/27/09
to laruby-...@googlegroups.com
Thats okay, you can always run html2haml on those ugly erb files ;)

On Mon, Jul 27, 2009 at 1:40 PM, Brian Miller <brim...@gmail.com> wrote:

Brian Miller

unread,
Jul 27, 2009, 5:47:38 PM7/27/09
to LA Ruby Code Jam
So great users of HAML, how do you go about doing nested loops in
javascript filters?
- @coords.each do |key, list|
- list.each do |coord|
= "map.addOverlay(new GMarker(new GLatLng(#{coord[:lat]}, #{coord
[:long]} %>), #{key}MarkerOptions));"
= "bounds.extend(new GLatLng(#{coord[:lat]}, #{coord[:long]}));"


On Jul 27, 1:59 pm, Ron Evans <ron.ev...@gmail.com> wrote:
> Yes, so far we have been doing the views in HAML... which is really
> quite cool if you have not used it.
>
> On Mon, Jul 27, 2009 at 1:40 PM, Brian Miller<brimi...@gmail.com> wrote:
>
> > Are we doing HAML or erb for the views? I've been lazy and just doing
> > erb, but I noticed the views for the pages are done in HAML.
>
> > Brian
>
> --
> Ron Evans
> 310-597-1013
> ron.ev...@gmail.com

Alf Mikula

unread,
Jul 27, 2009, 6:26:21 PM7/27/09
to laruby-...@googlegroups.com
I don't think you can do anything like that inside the javascript filter...You'd be better off writing a helper:

:javascript
  #{add_markers(@coords)}


-Alf

Brian Miller

unread,
Jul 27, 2009, 7:48:02 PM7/27/09
to LA Ruby Code Jam
That worked, thanks!

On Jul 27, 3:26 pm, Alf Mikula <amik...@gmail.com> wrote:
> I don't think you can do anything like that inside the javascript
> filter...You'd be better off writing a helper:
>
> :javascript
>   #{add_markers(@coords)}
>
> -Alf
>
Reply all
Reply to author
Forward
0 new messages