haml

Learning Rails: Create link to named route with only text in nested span

For the life of me, I can't figure out (or find the right text to search) how to create a link that looks like this: <a href="/publisher" class="button first"><span>This text will be hidden</span></a> There's a similar example in the link_to API, but it doesn't quite get to what I need. I don't want my anchor tag to have any text (all...

Ramaze's Haml engine returns same template every time

I've run into a problem with my very simple Ramaze project. My project is identical to the prototype project that is generated from 'ramaze create mywebsite', except that I'm using Haml templates (I set 'engine :Haml' in controller/init.rb). Here are the steps to reproduce the problem: Start the development server. I'm using Thin. V...

Contact form in ruby, sinatra, and haml

I'm new to all three, and I'm trying to write a simple contact form for a website. The code I have come up with is below, but I know there are some fundamental problems with it (due to my inexperience with sinatra). Any help at getting this working would be appreciated, I can't seem to figure out/find the documentation for this sort of...

Compass blueprint mixins undefined

I am trying to get compass/sass/haml working using blueprint but not having any luck with the blueprint mixins +column(24) just results in Sass syntax error undefined mixin column I'm sure I am just missing something really obvious but the compass/haml/sass/bluprint combo is just so many things at once I can't sort it out. ...

Is it worth to learn haml & sass?

In your professional experience have haml & sass proved to be useful? In which way? ...

Ruby / Sinatra / HAML flash message problem

I have the following small Sinatra application (I've removed the extra unneeded code): helpers do def flash(args={}) session[:flash] = args end def flash_now(args={}) @flash = args end end before do @flash = session[:flash] || {} session[:flash] = nil end post '/post' do client = Twitte...

How do I get an array of check boxes in haml?

Hi, I have an array of strings, called @theModels, in a routine implemented as part of a Sinatra server. These models are options for the user to select, and are obtained by the back end (the idea being, as new models are added, then the front end code should not change). I'm using haml to render html. How can I enumerate each eleme...

Library for making static websites with HAML/SASS/CSS framework

I'm looking for a library or a collection of libraries that work together with the following requirements: HAML and SASS can be used. Have a small server capability to see HAML/SASS compiled every time I refresh my browser. (I don't want to start a fresh Rails app, though.) Works with popular CSS frameworks. (Doesn't have to be all, bu...

How to generate Haml views instead of erb

I'm building an app with Rails 2.3.4 and using script/generate controller home index to generate a controller and home page. I've got Haml installed. I get an erb file: app/views/home/index.html.erb but I'd prefer to have a Haml file generated instead, like: app/views/home/index.html.haml I recall Merb would generate .haml view...

Sass options in Rails when installed as a Gem

I have Haml/Sass installed as a Gem and using it with Rails. I can't figure out, how to pass options like template_location and style to Sass. Sass::Plugin.options doesn't work (since Haml/Sass isn't installed as a plugin). The gem is required through Rails::Initializer#gem. Thanx a lot for help! ...

Can I learn Haml and Sass even if I don't know Ruby?

I downloaded Haml from here: http://rubyforge.org/frs/?group_id=2760. When I extract the zip there are a bunch of .rb files and the official web page talks about gems. I think this is some Ruby stuff. Can I learn Haml and Sass even if I don't know Ruby? If I have to, how do I install all this on Windows XP? ...

How do I make dynamic ids in Haml?

#item creates a div with id="item" .box#item creates a div with class="box" and id="item" .box#="item "+x creates a div with class="box" and a comment '#="item"+x' .box# ="item"+x throws "Illegal element: classes and ids must have values." How do I get set the id to a variable? ...

What would be some reasons to decide against HAML/SASS?

I've been reading up about HAML/SASS lately and I'm not quite sure why any one would not want to use it. It seems to be very easy to switch, makes things cleaner and more efficient. Update: What about using one or the other? Most of the complaints (the few complaints there are) I hear seem to be about HAML, would there be any probl...

Issue with Haml files

Hi i converting rails views from erb to Haml .The issue i faced is when use the form_for the haml throws the UNEXPECTED $end error. I am sure i did the space indentation well with in form_for .......Even if i use "each do" loop is says the same error. if i revert the haml to erb it works fine. Rails version i used : 2.3.2 & i installe...

HAML indentation issues

I'm pretty new to rails and haml.. and I can't get this to work right. I have this partial (_head.html.haml): !!! %html %head %meta{'http-equiv' => 'Content-Type', :content => "text/html; charset=iso-8859-1"} = stylesheet_link_tag 'main' %body And then in my application.html.haml: = render :partial => 'shared/head' #wrap...

Rails: App Templates / script generators with HAML?

Is there any way to create an app template in Rails that generates the views in HAML rather than ERB? App Templates: http://railscasts.com/episodes/148-app-templates-in-rails-2-3 If not, are there any plugins/gems that I can use to have all my generator scripts output HAML instead of ERB? ...

Standalone app or text editor plugin to convert Haml to html?

I've very interested in getting started with haml but have no idea what a ruby gem is. I am on a Windows machine and only plan to use haml for generating html. I've got no ruby experience whatsoever but want to play around with haml. any ideas? ...

haml and no javascript? (rails: form_remote_tag and :with parameter)

i am trying to call a remote method to update page content via ajax/js. either i am too tired already or haml is not parsing the following code correctly to send the value of the query field via prototype. any ideas? - form_remote_tag(:url => {:controller => "search", :action => "line"},:with => "'query=' + $('query').value" ) do %inp...

Including partial template

Hi In sinatra's app, require 'rubygems' require 'sinatra' require 'haml' get '/new' do haml :new end get '/edit' do haml :edit end __END__ @@ layout %html %head %title %body = yield @@ _form # partial form @@ new %h1 Add a new item # require partial _form @@ edit %h1 Edit an existing item # require partial _form ...

Help with HAML: Mixing text and other HTML tags

I am converting my ERB template to a HAML template. <p> Welcome to <span><%= name1 %> </span>, <span> <%= name2 %></span> and <span><%= name3 %></span>. </p> This is what I have come up with %p Welcome to %span= name1 , %span= name2 and %span= name3 . I have a feeling that there is much more elegant way to do this...