How does HAML get compiled?

7 views
Skip to first unread message

webbieguy

unread,
Nov 7, 2009, 5:17:49 PM11/7/09
to Haml
Hi,

I am a Ruby on Rails newbie and am trying to use Haml. I love the
different aspects of and would love to use it for everything. One
simple problem which I can't seem to find the answer to. How does it
get compiled?

I have haml files in a Ruby on Rails project in Aptana and I made the
assumption that when you start the server, the files are compiled to
html, but I think I am incorrect in that assumption. I have yet to see
a compiled haml file in a browser. I know this is probably super
simple, but if someone could please tell me what to do I would greatly
appreciate it.

Regards,
Justin

Nathan Weizenbaum

unread,
Nov 7, 2009, 6:13:20 PM11/7/09
to ha...@googlegroups.com
If you're using Haml with Rails, it'll work just like ERB (once you have the plugin installed, that is): you write your views with the extension ".html.haml" and then when you go to view them in your browser, it's automatically compiled behind-the-scenes.

Does that help?

webbieguy

unread,
Nov 7, 2009, 11:23:59 PM11/7/09
to Haml
Yes it does. Now however, I am getting a pagination error. Is there an
easy to install gem available for this?

Thanks in advance!!

On Nov 7, 5:13 pm, Nathan Weizenbaum <nex...@gmail.com> wrote:
> If you're using Haml with Rails, it'll work just like ERB (once you have the
> plugin installed, that is): you write your views with the extension
> ".html.haml" and then when you go to view them in your browser, it's
> automatically compiled behind-the-scenes.
>
> Does that help?
>

webbieguy

unread,
Nov 7, 2009, 11:24:28 PM11/7/09
to Haml
I forgot to say that I am using haml_scaffold to generate my haml
files.

On Nov 7, 5:13 pm, Nathan Weizenbaum <nex...@gmail.com> wrote:
> If you're using Haml with Rails, it'll work just like ERB (once you have the
> plugin installed, that is): you write your views with the extension
> ".html.haml" and then when you go to view them in your browser, it's
> automatically compiled behind-the-scenes.
>
> Does that help?
>

Nathan Weizenbaum

unread,
Nov 8, 2009, 3:12:13 PM11/8/09
to ha...@googlegroups.com
I'm not sure what you mean by a "pagination error".

Norman Clarke

unread,
Nov 9, 2009, 7:54:00 AM11/9/09
to ha...@googlegroups.com
I am guessing you that you haven't set up will_paginate? Haml_scaffold
by default adds code that depends on will_paginate, but doesn't
install the gem nor does it configure it in environment.rb.

So make sure you have a line like

gem "will_paginage"

in your environment.rb, and it should work "out of the box."

Regards,

Norman
Reply all
Reply to author
Forward
0 new messages