haml

How to write a view helper that renders works with HAML and ERB?

Hi I am working on a gem that defines a few view helpers and it heavily relies on concat and capture methods but I've recently discovered it doesn't work with HAML (haven't tested thoroughly, but so far doesn't render concat(nated) stuff). I read somewhere there was a haml_concat version of concat. So If I just need to change my concat ...

Conditionally set HTML element id with HAML

I am attempting to write this html in haml so as to add an id tag if the item is the current one. This is to setup for jquery highlighting. <% if line_item == @current_item %> <tr class="line_item id="current_item"> <% else %> <tr class="line_item"> <% end %> <td><%= line_item.quantity %>&times;</td> <td><%= line_item.product.titl...

How to cache HAML files in /tmp directory?

I'm having an issue with HAML where it is attempting to write to a read-only filesystem (on a Heroku-deployed app). I can only write to /tmp and /log. How can I configure HAML to write files to the /tmp directory? Thanks! Edit: Output of actual error Started GET "/" for <ip> at Sun Oct 03 13:19:42 -0700 2010 Processing by Welcom...

What is a good Ruby on Rails forum that can easily integrated to an existing application?

What is a good, open source RoR 3 forum that can easily integrated to an existing application? Optional features: OpenID support Haml/SCSS templates Support for smilies, YouTube, images, etc I'm probably going to change it alot, and I'm still pretty weak in Ruby, so clean, commented code with good practices would be great. Thanks :)...

Why scss is not blowing up for wrong css value

I am using scss with haml in my rails3 project. I mistakenly typed zindex: 99999 instead of z-index: 9999 SCSS did not blow up. I thought one of the benefits of using haml/sass/scss was not invalid css values are not allowed. ...

Rails 3: undefined method `remote_form_for'

I have a fairly simple Rails remote form in HAML in a partial under shared/users: - remote_form_for :user, :url => { :controller => "users", :action => "create" } do |f| .field = f.label :name, t('name') = f.text_field :name .field = f.label :email, t('email') = f.text_field :email .actions = f.submit No matt...

force clojure :reload

I noticed that (use 'somemodule :reload) doesn't reload the module if the .clj file was not modified. However I have an usecase for forcing the reload of the module even if the file isn't changed. I created a haml macro for clojure which reads an external file and generates clojure code. ( http://www.coldcode.net/2010/10/haml-macro-for...

When using HAML, is there a way to use heredoc or %Q{ ... } ?

Maybe it can be put into a helper but the existing 500 lines of code has everything in the HAML code, so it is better to follow the existing code for the moment (for tight deadlines). I found the only way working right now is - meta_tag = %Q{\n | <meta ...>\n | <meta ...>\n | [...] \n | } | which is to use the "continuati...

how to include 5 <BR>'s in Haml?

this code = 5.times {|n| puts "<BR>"} does nothing for me ... ...

how to use variables inside loop in haml?

how can I have in the second line the value of the variable file instead of both strings file? - files.each do |file| %a(href="test?run=file")click file ...

Can I use the nHaml code base to convert haml files to HTML to offer a ajax preview of HTML generated?

I have a requirement for a preview of generated html from Haml entered in to a text area. I need to be able to show the generated HTML to a user entering haml in to a text area using Ajax to call a server back end. Can / How do I take a string of haml and parse it to HTML using nHaml? ...

how does processing flow in haml work?

I have a run.haml file where I run a test suit. Everything works just fine but I want to display the text "Starting test suite: #{params['run']}" immediately after user clicks the link that leads him to this haml. the link clicked tells haml what suit needs to be executed %a(href="run?run=#{file}") Right now everything is displayed ...

how to inject into sintra/haml?

I coded small web app that runs ant (batch file). The processing time of the batch file could take up to minutes. index.haml list all available ant files and run.haml runs them. The flow how it works now is that when I click a link from index.haml the ant script is run and after it finishes the whole run.haml page is sent to the browser...

unnecessary debug info in rails view

In my rails app I'm displaying some posts using nested loops. In development mode, after each loop completes the post objects are dumped in plain text in sequence. So it looks like this: It's unnecessary and kind of obnoxious. What causes this behavior and how do disable it? Edit: here is the loop: = @posts.each do |post| .post %...

Datamapper validation errors with Sinatra

I'm trying to validate my Datamapper models and show the validation errors in my HAML template, I'm using Sinatra. I'm at loss how to save those errors into an instance variable and access them from my template. I've looked around for some documentation or tutorials explaining how to do something like this but I haven't been able to find...

`rescue in load_missing_constant': uninitialized constant Sass::Script (NameError)

Hi, I am trying to run Shapado (A rails based Stackoverflow clone). While running the script I get the following error - `rescue in load_missing_constant': uninitialized constant Sass::Script (NameError) I have haml installed - Haml/Sass 3.1.79 (Bleeding Edge) I do not understand how to get around this error. Can you give some pointer...

mailing list using JQuery, Sinatra, HAML fails with "undefined" email address

Somehow, a simple form I have to sign up for a mailing list (which adds an email to a Google Apps Group, using gdatav2rubyclientlib) seems to fail occasionally. The form is submitted via POST through jQuery, and the Sinatra app (running on nginx/Passenger) handles the POST and emails me a confirmation. Occasionally, I get emails that "...

syntax error, unexpected kENSURE

Hi, I have a problem in solving this. = link_to "Bounced", bounced_email_path(@email) Bounces %span = @email.bounces_count I want the Bounces ,span and other lines within the link tag.. could some please help me with is.. the above code ends up in an error "syntax error, unexpected kENSURE, expecting $end". thank you ...

Missing keyword_end on haml partial template processing

Because I was getting myself annoyed with the HTML tags, I started to convert my project to HAML, since it is a lot better structured. I am glad the installation provides the tool html2haml to help me with it. While being syntactically correct, processing the file gives me a weird error I don't quite get: /stories/_story.html.haml:28: ...

rendering a partial from a haml file

I have a simple sinatra app that uses haml and sass for the views. One of the views (located in the views folder) is a partial for my navigation menu. I am trying to render it from index.haml but I get the following error: wrong number of arguments (1 for 2) I am trying to render it with the following lines in index.haml .navigation ...