haml

Haml: how do I set a dymanic class value?

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....

What is the best method for storing SASS generated CSS in your application and souce control?

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...

Your attitude to Haml?

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. ...

Should I use haml or erb or erubis for potentially high traffic site?

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...

How do I get Haml to work with Rails?

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. ...

How to chain pseudo selectors in SASS

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?

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#! ...

Javascript HAML editor

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...

In Rails, how do you use RESTful controllers with Haml?

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|...

What are best practices for using frames (or iframes) with Rails?

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 ...

Haml and Sass for Programmer's Notepad??

Does anyone know where I can find some cool syntax highlighting for Haml and/or Sass for the Programmer's Notepad? Thanks! ...

Is there a HAML implementation for use with Python and Django

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...

How can I get Haml to render the contents of a pre tag correctly?

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...

Under what cirumstances would I need eruby if I'm just doing Ruby programming

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...

How to use haml with heroku ?

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...

Best practice: setting HTML classes in a webapp

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...

Which Java HTML templating technology works in a way that is closest to Ruby (erb/haml)?

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...

Can Haml be used in Java web apps?

I hear about Haml as a templating engine mostly in the Ruby world. Can it also be used in Java projects? ...

What's are the main differences between Haml, Sass/Compass and erb?

I'm looking for a templating engine. What are the important factors to consider when choosing among Haml, Sass/Compass and erb? ...

Storing Application Text: Inline vs. Separate File

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...