To use Haml with a Rails application, you have to configure the Rails
application to be aware of the Haml gem. You can do this by specifying
a ‘config.gem Haml’ line in the ‘config.rb’ file (or gem Haml if you
are using Egde Rails soon to be known as Rails 3).

After that line, make sure to run ‘rake gems:install’ to install the
gem for your project. Optionally, you can run ‘rake gems:unpack’ to
unpack the gem files into your vendor directory.

All these hassle can be done automatically by using a template created
by Chris Eppstein; thanks Chris.
If you are running Rails 2.3.*, you can follow the following steps:
1. To install Haml and Compass/Sass into a new application => 'rails
<appname> -m http://compass-style.org/rails/installer'
2. To install Haml and Compass/Sass into an existing application, use
the application template rake task => 'rake rails:template
LOCATION=http://compass-style.org/rails/installer'.
You van also set the NO_SUSO option to disable the interferance of the
super user in the script like so: 'rake rails:template LOCATION=http://
compass-style.org/rails/installer NO_SUDO=true'

Compass/Sass is an amazing scripting language that generates CSS. You
can integrate frameworks such as Blueprint with it too. Check them
out.

Hope this helps.

- Igbanam

On Sep 6, 11:45 am, "sol.manager" <sol.mana...@gmail.com> wrote:
> Thank you so much. I have been all over the examples, but still feel
> like a dog chasing a car. Now I can see why mine code wasn't working
> and I appreciate the assistance.
>
> On Sep 6, 11:29 am, Hampton <hcat...@gmail.com> wrote:
>
>
>
> > Should be more like this:http://pastie.org/1141671
>
> > I haven't tested it... but you don't use <% end %> or <% <%= %> at all!
>
> > End's are assumed. Check out haml-lang.org for plenty of examples!
>
> > -hampton.
>
> > On Mon, Sep 6, 2010 at 3:51 PM, sol.manager <sol.mana...@gmail.com> wrote:
> > > I am new to this whole Haml thing as of last night and am very
> > > impressed. I tried switching over a simple .erb template to .haml and
> > > having a problem. I am guessing I didn't properly Haml the section
> > > below my / note. I have tried a few things but no luck. So, can anyone
> > > tell me what is wrong with the following? (this is all the code in my
> > > partial named /contacts/_contact.html.haml
>
> > > %table
>
> > >  %tr
> > >    %th avatar
> > >    %th contact name
> > >    %th city
> > >    %th email
> > >    %th mobile
> > >    %th phone
> > >    %th company name
> > >    %th action(s)
>
> > >    / this and probably the remainin lines still need proper Haml
> > > markup. I am not doing something rite
> > >    <% @contacts.each do |contact| %>
>
> > >  %tr
> > >    %th <%= image_tag contact.avatar, :class => 'img_avatar_thumb' %>
> > >    %th <%= contact.first_name %> <%= contact.last_name %>
> > >    %th <%= contact.city %>
> > >    %th <%= contact.email %>
> > >    %th <%= if !contact.mobile.blank? %><
> > > %=number_to_phone(contact.mobile, :area_code => true)%> <% end %>
> > >    %th <%= if !contact.phone.blank? %><
> > > %=number_to_phone(contact.phone, :area_code => true)%> <% end %>
> > >    %th <%= contact.company_name %>
> > >    %th <%= link_to image_tag("/images/buttons/
> > > ico_buscard.png", :alt=>"Show contact card"), contact %> <%= link_to
> > > image_tag("/images/buttons/ico_edit.png", :alt=>"Edit contact"),
> > > edit_contact_path(contact) %> <%= link_to image_tag("/images/buttons/
> > > ico_delete.png", :alt=>"Delete contact"), contact, :confirm => 'Are
> > > you sure?', :method => :delete %>
> > > <% end %>
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Haml" group.
> > > To post to this group, send email to h...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > haml+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/haml?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to h...@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to