I am trying to run haml interactively from the Rails console. I
converted an Erb file to corresponding Haml code as follows (used
html2haml off course):
%h1
Listing comments
%table
%tr
%th
Person
%th
Blog
%th
Body
%th
Type
- for comment in @comments
%tr
%td
= h comment.person_id
%td
= h comment.blog_id
%td
= h comment.body
%td
= h comment.type
%td
= link_to 'Show', comment
%td
= link_to 'Edit', edit_comment_path(comment)
%td
= link_to 'Destroy', comment, :confirm => 'Are you
sure?', :method => :delete
%br/
= link_to 'New comment', new_comment_path
Now I know that I need to load the @comments variable so I did a
@comments = Comment.find(1)
at the console prompt and then typed in the following:
>> haml #{RAILS_ROOT}/app/views/comments/index.html.haml
NameError: undefined local variable or method `haml' for #<Object:
0xb7d9b9a0>
from (irb):11
from :0
Now I know that haml is a command line utility, but I would like to
check the converted haml files in the context of my Rails
application. Is there a way that it can be done using the Rails
console?
Thanks.
Bharat
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---