haml

Is it possible to generate plain-old XML using Haml?

I've been working on a piece of software where I need to generate a custom XML file to send back to a client application. The current solutions on Ruby/Rails world for generating XML files are slow, at best. Using builder or event Nokogiri, while have a nice syntax and are maintainable solutions, they consume too much time and processing...

Weird Haml 3 error with ruby 1.9.1 and rails 3

I'm getting this weird error on my windows 7 computer when I am using the html2haml command with Haml 3 and Rails on Ruby 1.9: -- control frame ---------- c:0017 p:-9593720 s:0052 b:0052 l:000051 d:000051 TOP c:0016 p:---- s:0050 b:0050 l:000049 d:000049 CFUNC :require c:0015 p:0026 s:0046 b:0046 l:000045 d:000045 TOP C:/Ruby/lib/ru...

Displaying large forms on the iPhone

I'm currently in the process of toying with a few things at the same time: Heroku, Sinatra, HAML/SASS, and of course the glue: Ruby. I'm loving that, and it all goes well with DataMapper. However, my current "project to learn by" seems to be pretty data-intensive. Though it is also something I want to have. I've been a bit of an amat...

Rails: i would need to load a haml file in a class and render in the caller

I have this: app/modules/grid_module.rb app/modules/grid.html.haml then in my view: app/views/layouts/default.html.haml I want to make a new instance of the grid_module and render it content. Its content is into the grid.html.haml and this file can only use the instance vars set in the grid_module.rb is this possible to do? (the grid ...

Rails: load a html.haml file and render it in the view?

How to load a html.haml file from a custom class, store in a var its data, then apply some instance variables and render it in the view? ...

Skin Twitter HTML and CSS

I am building a twitter application and would like to use the structure of the their homepage. Can anyone suggest how to go about doing this, or point to a reference that does this? I do not intend to use any images that would be considered copyright, I just want to use the single column layout, with the side panel, header, footer. Tha...

How can I transform this haml into a table?

I have the following haml code: - @theLinks.each_index do |x| %br %form{:action=>'/Download', :method=>"post",:enctype=>"multipart/form-data"} %input{:type=>"submit", :name=>"#{@theLinks[x].url}", :value=>"Name: #{@theLinks[x].Name} Study Time: #{@theLinks[x].studyTime} Comments: #{@theLinks[x].comments}"} Basically, for ea...

nested columns in compass/sass

I've been studying compass and while it is a fun thing to play with and use, one thing bothers me(besides being unable to add padding as it wrecks the grid), how do I nest columns? I want to be able to do what blueprint does: nest containers like say, I have a 24-column page divided in two(17 and 7 columns). In the right part of that pa...

rails + compass: advantages vs using haml + blueprint directly

I've got some experience using haml (+sass) on rails projects. I recently started using them with blueprintcss - the only thing I did was transform blueprint.css into a sass file, and started coding from there. I even have a rails generator that includes all this by default. It seems that Compass does what I do, and other things. I'm tr...

Sass mixin not compiling?

I have previously made a mixin in sass 2.2.22 for my font sizes(it's a font converter), like so: =6.5pts :font :size 9px It has been working ever since i first made it a year ago. We just upgraded to haml/sass 3 and now whenever I try to refresh the page im working on, a sass compile error appears like so: http://grab.by/4yFE ...

using the :sass filter with :css

We are currently making a widget that requires some default declared styles along with it(widget html is included by javasacript, along with the default css in style tags) but the problem is i can't "chain" haml filters. What I'm trying to do is to add an internal stylesheet along with the widget like so: <style type="text/css"> p {c...

how to put breakpoints in haml files in eclipse? It just doesnt work...

how to put breakpoints in haml files in eclipse? It just doesnt work... ...

Pass selected option to remote_function with Ruby on Rails

I have a list of options generated by the following Haml code. %select#tags{:onchange => remote_function(:url => {:action => :display_tag_cart}, :with => 'Form.Element.serialize(this)'), :prompt => 'Choose a Tag'} %option{:value=>""} Choose a Tag -Tag::TAGS.each do |t| %option{:value=>t.id} =h t.name For...

:with clause preventing action from getting executed in link_to_remote call

I'm experiencing problems with the :with clause in the following code. -counter.times do |c| -elem = @tags[c] #{elem.name}#{link_to_remote image_tag('x.png'), :url => {:controller => 'questions', :action => 'remove_tag_from_cart'}, :with => "'tag_remove=' + #{elem}"} If I take out the :with clause, then remove_tag_from_cart gets e...

I can't set breakpoint in .haml files in eclipse IDE. I open .haml files with aptana.

I can't set breakpoints in .haml files in eclipse IDE. I open .haml files with aptana. ...

Possible to embed markdown within erb?

If you use haml as rails view template, you can write portion of your page using markdown by using the ":markdown" filter. Is is possible to do the same using erb? ...

How to create a link in Sinatra that points to a directory of files?

I have an application that calls an other application that populates a directory. Once it is finished I want to provide a link to the directory that contains the created files and people can examine or download them via the browser: For example this works to provide a link to a single file: (Note this uses HAML) but the idea is the sam...

Postgres error with Sinatra/Haml/DataMapper on Heroku

I'm trying to move a simple Sinatra app over to Heroku. Migration of the Ruby app code and existing MySQL database using Taps went smoothly, but I'm getting the following Postgres error: PostgresError - ERROR: operator does not exist: text = integer LINE 1: ...d_at", "post_id" FROM "comments" WHERE ("post_id" IN (4, 17,... ...

HAML-like syntax for non-HTML documents?

I love using HAML for HTML documents. It has clean syntax that's much more attractive than ERB. It works perfectly for HTML documents. What about for non-HTML? Such as, for example, an email or text document with certain automatically-substituted components? I've been falling back to ERB, but don't like the heavy syntax compared to HAML...

Manually output HAML start and end tags

I have some code: - count = 0 - @clients.each do |client| %div{:class => "grid_2#{(" alpha" if (count % 3) == 0) || (" omega push_2" if (count % 3) == 2) || " push_1"}"}= link_to h(client.name), client - count += 1 I want to output an opening div tag right after the each statement if the (count % 3) == 0 and out put the end ta...