haml

Strange issue using HAML

When I copied _form.haml partial to _edit_form.haml partial and replaced "_form", with "_edit_form" in my edit.haml I got strange error (maybe it is not strange, I just cant understand the reason). wrong number of arguments (0 for 1) Extracted source (around line #1): 1: = form.label :email 2: %br 3: = form.text_field :email 4: %br ....

elastic css framework with rails 3 and haml/sass ?

hello fellow programmers, i recently stumbled upon "elastic css" framework, which looks like a good thing to me. i tried blueprint already but i must say this seems to be an overkill for me (tried it with compass). so my question to you rails/xhtml webdevelopers out there: is the elastic css framework together with rails (3) and haml/sa...

Whitespace Between Tags in HAML

Is there a way to specify "pretty-print"-like formatting around HTML tags? I want to be able to put whitespace between blocks of HTML, so this: <!-- container --> <div id='container'> </div> <!-- footer --> <div id="footer"> </div> <!-- analytics --> ... ...is converted to this: <!-- container --> <div id='container'> </div> <!-- ...

Rails + Haml: Returning from a partial will somehow remove the form tag

This is lengthy, yes, I apologize. But I want to be clear because this issue is so odd. I have a terms of service modal that comes up whenever a user has not accepted our terms of service (TOS). For the purposes here, javascript is turned off and what is rendered is strictly html/css. So the page, if thought of in 3 layers, is: bottom l...

Test nested layout helper with RSpec and Haml

In ApplicationHelper I have such code: def inside_layout layout = 'application', &block @template.instance_variable_set '@content_for_layout', capture(&block) concat \ @template.render :file => "layouts/#{layout}", :use_full_path => true end which behaves like this: application.html.haml: !!! %html %head ... %body ...

Having problems using haml and rails3

After installing rails3, I'm experiencing problems when trying to use haml with it. I have the updated gem installed, and after rails PROJECT_NAME , I did haml --rails in its root. It apparently had worked fine, since I have haml folder inside plugins, init.rb, as expected. But when I try to rake, or rails server, I get: rake aborted...

undefined method error appears in erb but not haml

Hey all, All I wanted to do was convert a haml file to erb. After doing so, i get an undefined method `render_sequence_nav' error message. Even though no such error happened when it was in haml format. In the haml file, there is this line: #fields << render_sequence_nav(sequence_info, students_path) fields << render(:partial => ...

How to build nested menu "trees" in HAML

Hey there, I am trying to build a simple nested html menu using HAML and am not sure how to go about inserting the elements with the correct indentation, or the general best way to build nested trees. I would like to be able to do something like this, but infinitely deep: - categories.each_key do |category| %li.cat-item{:id => "ca...

haml with rails3 (git master) and devise: form_for syntax change breaks haml -- suggestions?

i am trying to get haml working with a rails3 project; since i am quite far in the modeling i wanted to go to the haml views now -- seems that the current haml (git master) does not work together with the current rails3 git master because of some syntax changes in rails3 form_for does anyone have more information on the syntax changes?...

searching for a guide how to setup mongo_mapper, devise, haml with rails3

is there a full setup guide for mongo_mapper, haml, rails3 and devise, for the current git (master) branches? a lot of things changed in all of those frameworks/libs lately. i was wondering if somebody has it up and running and can share it on github or give some pointers... ...

Multiple Haml Elements on Same Line

I want to be able to have two Haml elements on the same line. For example: %h1 %a{:href => '/'} Professio. That doesn't work. How would I get something like this to work without borking? ...

Haml in Maruku Filter

For this project, I need to be able to mix Haml tags within the Maruku filter. For example, will I be able to do this: #contain :maruku ## Hello H2 Tag div{:id => 'divinmaruku'} **Can I do this?** I know you can just unindent where you want to get out Maruku, but it is a pain to do :maruku whenever I want to use it...

Multiple forms + HAML + jQuery + Javascript submit

Hi. I have a HAML page that lists some links to delete "things" that looks like this %div %a.form_submit Delete Thing 1 %form{:href=>"#", :id=>'comment_1', :method=>'post', :action=>'/thing/delete'} %input{:type=>'hidden', :name=>'thingid', :value=>'1'} %input{:type=>'submit', style='display:none'} %div %a.form_s...

Help me understand dynamic layouts in Sinatra

Help me understand this; I'm learning Sinatra (and Rails for that matter, er, and Ruby). Say I'm doing a search app. The search form is laid out in one div, and the results will be laid out in another. The search form is rendered into the div by a previous view (maybe from a login form). I want to process the form params, perform the...

Parsing atom/rss feed containing multiple <link> tags with Haml on RoR

So, firstly, here's an Atom feed snippet which I am trying to parse: // http://somelink.com/atom <feed xmlns="http://www.w3.org/2005/Atom"&gt; <entry> <title>Title Here</title> <link href="http://somelink.com/link1&amp;amp;amp;ref=rss" rel="alternate" /> <link href="http://somelink.com/link2&amp;amp;amp;re...

How to disable Rails submit buttons alongside Prototype helpers & RJS?

I'm trying to follow this post http://stackoverflow.com/questions/576240/how-can-i-unobtrusively-disable-submit-buttons-with-javascript-and-prototype but I can't get it to work. The form triggers an RJS function, so I need to keep the helpers' onclick events intact. The RJS returns/reloads the same forms along with two new texts. I'm r...

What is the easiest way to get an embedded upload progress bar using Ruby/Sinatra/Haml/Passenger/nginx?

I have a website where people can upload 30+mb of data in a single block, and I want to be able to show them the progress of their upload without causing the web page to become unresponsive, similar to how flash uploads work in gmail. There's this question here, but I don't know if that progress bar is embedded in the page or if it's us...

Ruby on Rails: How to verify haml files syntax within rails project?

I've installed HAML into my project and it is working like a charm - the templates are beeing rendered without a problem. My question is how can I do the rendering on the command line, by using HAML program. That would be super for debugging purposes, meantime while I try to compile HAML file I get the error on first Rails related Ruby c...

Create a helper or something for haml with ruby on rails

Hello, i am using haml with my rails application and i have a question how the easiest way to insert this haml code into a html file: <div clas="holder"> <div class=top"></div> <div class="content"> Content into the div goes here </div> <div class="bottom"></div> </div> And i want to use it in my haml document like this: %ht...

If statement with code on same block in haml, RoR

Hello, i have this Haml view: !!! strict %html{:xmlns => "http://www.w3.org/1999/xhtml"} %head %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"} %title Lighty | #{@page_title || "Home"} %body #popup Login here #fade #wrapper #container #header ...