I have the following html.erb code that I'm looking to move to Haml:
<span class="<%= item.dashboardstatus.cssclass %>" ><%= item.dashboardstatus.status %></span>
What it does is associate the CSS class of the currently assigned status to the span.
How is this done in Haml? I'm sure I'm missing something really simple.
Edit: Gah....
If you are using HAML and SASS in your Rails application, then any templates you define in public/stylesheet/*.sass will be compiled into *.css stylesheets. From your code, you use stylesheet_link_tag to pull in the asset by name without having to worry about the extension.
Many people dislike storing generated code or compiled code in...
I'm considering Haml as a templating engine to use with PHP (via phammable).
Do you know any potential drawbacks to using it? Googling seems to glorify it too much, all that markup haiku thing.
...
I have been playing with Haml recently and really like the way the resulting code looks to me...the developer. I'm also not too worried about a designer being able to consume or change it...we're a small team.
That said, beginning work on a project we believe will generate quite a bit of traffic (who doesn't?). I'm concerned that there...
I am trying to get Haml to work with my Ruby on Rails project. I am new to Ruby on Rails and I really like it. However, when I attempt to add an aplication.html.haml or index.html.haml for a view, I just receive errors.
I am using NetBeans as my IDE. Any help would be appreciated.
...
I'm trying to put together a selector in SASS that will operate on the visted, hovered state of a link, but I can't quite seem to get the markup right, can someone enlighten me?
I was writing it like this:
&:visited:hover
attribute: foo
...
Should I learn NHaml?
What does it provide me over a classic ASP.NET MVC view? What are the pros and cons?
Are you using it via the MVC Contrib project?
I have been seeing more and more about it. For example... I saw a blog post by Matthew Podwysocki using ASP.NET MVC, NHaml, and F#!
...
Does anyone know of a Javascript based HAML editor out there? I'm looking for for something like TinyMCE that just understands HAML (so it does indenting and highlighting correctly)
I'm thinking of using an editor like this for a dynamic website I'm building.
Clarification
The site I am building allows the users to define layouts(in t...
I'm getting started on figuring out how to use RESTful design. I have this action:
# GET /feedback_messages
# GET /feedback_messages.xml
def index
page = params[:page]
page ||= 1
@feedback_messages = FeedbackMessage.paginate(
:all,
:page => page,
:per_page => 20,
:order => 'updated_at'
)
respond_to do |format|...
I'm building a Ruby on Rails app where people are clicking on addresses. When they click, I want to display a small google map of the address in a frame (I want to use a frame/iframe so when they scroll down to look at more addresses, the little map won't scroll off too.) I'm having a hard time finding examples or discussions of this. I ...
Does anyone know where I can find some cool syntax highlighting for Haml and/or Sass for the Programmer's Notepad?
Thanks!
...
I happened to stumble across HAML, an interesting and beautiful way to mark up contents and write templates for HTML.
Since I use Python and Django for my web developing need, I would like to see if there is a Python implementation of HAML (or some similar concepts -- need not be exactly identical) that can be used to replace the Django...
I read the Haml docs where they talk about the pre tag and "preserving whitespace". According to the docs, pre "preserves whitespace" by default and you need to use the ~ operator to output the contents of the tag to get it to render correctly. Following the recommended practice, I have this:
%pre
~ @calendar.main_template
The outpu...
As I understand it, eruby is like erb - it lets you stick ruby code into HTML. If someone is using Rails, more than likely they would use erb or Haml.
But if I'm not using Rails, under what cirumstances would I need eruby if I'm just doing Ruby programming?
I guess I don't understand why someone would need to be outputting HTML if th...
Hello
I try to get haml working without the gem with sinatra (Heroku doesn't allow gem install, as far as I know)
What I've done so far:
clone the haml git repo inside my project
add : require 'haml/lib/haml.rb' to my sinatra main file
the following works:
get '/test' do
Haml::Engine.new('%p test').render
end
but the following...
In every webapp I build, I come across this issue. I want to set classes on HTML elements conditionally. For example, sometimes the <div> for a post looks like:
<div class="post">...</div>
And sometimes it looks like this:
<div class="post even recent replied_to author_is_admin">...</div>
Each class after post is there because some...
Among the Java templating solutions such as Apache Velocity, Freemarker, Hamlets, Tapestry, StringTemplate, JSP, JSP Weaver (others?) which would most closely approximate the conciseness and simplicity of similar HTML templating solutions in Ruby - haml/erb. I'm concerned both with the syntax of the templating engine as well as how simpl...
I hear about Haml as a templating engine mostly in the Ruby world. Can it also be used in Java projects?
...
I'm looking for a templating engine. What are the important factors to consider when choosing among Haml, Sass/Compass and erb?
...
I'm working on a Merb application using Haml as the templating language. As haml encourages moving logic out of the view and into helpers, I soon started thinking about removing the copy / text from the templates themselves. In the past I have either just left the text inline within the templates, or moved it into separate yaml files sep...