haml

How can I get all the checked items from a submitted form with sinatra's params?

I'm running Sinatra 1.0 with HAML, my form has a number of checkboxes, for example books I like, and you would select all the books you want. The checkbox name is "books". In sinatra params['books'] there should be an array of all the books that were checked, but it only has the last item that was checked, not an array. How can I get a...

Haml::SyntaxError in Static#home?

I have this Haml: #index-header %h1 Supersonic Mac Software. %p Some motto %h1 Our Software %p Which will once becoume your's .third-column %h2 Product 1 %p LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL .third-column %h2...

Loading an FLV in Facebox with jQuery for IE7 and IE8

It goes almost without saying, this works perfectly in Chrome, Firefox, and Safari. IE (any version) being the problem. Objective: I am trying to load JWplayer which loads an FLV from S3 in a Facebox popup. jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox() }) HTML (haml): %li#videoGirl = link_to 'What is HQcha...

Using colon syntax and variables in Sass

I am still using the old colon syntax (I prefer it more than the bracket syntax) and this particular code: a.button-link +box($main-color) +border-radius(5px) :background :color $main-color :color #fff :padding 5px generates a warning like so: DEPRECATION WARNING: On line 12, character 3 of '/Users/eumir/rail...

Formatting populated textarea, carriage returns, newlines, and HAML

When i populate a textarea with text using \r\n (carriage return - newline) the text is formatted improperly [UPDATE: \r\n is what is generated when filling out a textarea, i'm simply pulling from a database what was previously filled in. Also to note, in the production environment i don't seem to have this problem. END UPDATE] For examp...

How do I nest a div inside an anchor tag in rails.

I'm a bit of a Ruby on Rails amateur, and I am trying to nest a div tag inside of an anchor tag in rails. I can make it work, but the resulting code I have written is terrible and is certainly NOT the rails way. Here is an example of what I am trying to accomplish in HTML: <a href="tell-a-friend"> <div id="tellafriend"> <strong>Str...

Conditional tags with HAML

I have this haml: .kudobox %div.kudos= number_to_human_size_not_bytes kudos %div= (kudos == 1 || kudos == -1) ? "kudo" : "kudos" Now I want the .kudobox have a positive, negative or zero class, depending on the number of kudos: -# < 0 kudos <div class="kudobox negative"> -# == 0 kudos <div class="kudobox zero"> -# > 0 kudos <di...

Using liquid with haml

Hi All, I'm planning to develop a CMS with ruby/rails. One of the main key features that I'm planning is to give the user to edit their layout (I'm planning to do this through liquid) meanwhile i have red some good articles on HAML and SaaS. So just wondering whether i can use haml + liquid + sass for my work If possible i would thank...

Using harsh with generated code

I have code in @snippet.code, and I want to highlight it with harsh: :harsh #!harsh theme = lazy = @snippet.code However, this just highlights @snippet.code, so the output is: <pre class="lazy"><span class="Keyword">=</span> <span class="Variable"><span class="Variable">@</span>snippet</span>.code&#x000A;</pre> How can I use Ha...

Ruby HAML with Django?

Ok, so I really love HAML. Particularly, I love the integration with RedCloth and BlueCloth, so I can use Markdown and Textile intermixed with my HAML. I also love Python and Django. So, I would like to use HAML with Django. Now, I already understand that there are some attempts at cloning HAML-like syntax in Python (SHPAML and other...

simplify my multiline regex - match plus next x amount of lines

I have the following Haml code: %ul#sub-nav %li.li1 %a{:href => "/dsadasd/"} dasdasd %li.li2 %a.selected{:href => "/asdadasd"} Tasdada /asdas %li.li3 %a{:href => "/dasd/"} asdasd %li.li4 %a{:href => "/wdasn/"} das I seem to be able to match this with the following repetitive rege...

I can't install Haml/Sass on Windows using RubyInstaller for Windows.

I never used ruby before, I just wanted to play around with HAML and SASS. I downloaded and installed Ruby's Windows installer (v1.9.1). Then, I clicked ruby.exe (the icon with a black window and a multicolored gem in the picture). Finally, I typed gem install haml and pressed Enter. But nothing happened. Am I doing something wrong? Ref...

Fastest and most efficient way of converting **haml** and **scss** files? (Ruby on Windows)

I'm a ruby/haml/sass-beginner. I just installed ruby and rails for windows, haml, and sass (stand alone and plugin for rails). I know how to convert and haml file into a html file (and vice versa): haml index.haml > output.html and how to convert a scss fiel into a css file (and vice versa): sass --watch style.scss:style.css I sav...

How do I automatically update the html output of a haml file like I do with a sass and css file?

"Watching a file" helps me to automatically update the changes I make in the sass file to the css output. To watch a Sass file is very simple: sass --watch input.sass:output.css but for a Haml file I can't find a similar command Any suggestions? ...

Is it too redundant to use HAML if I'm already using PHP in my project?

I'm not very clear about HAML, but as far as I know it is a templating language, and PHP already has that functionality. Would it make sense to include PHP syntax inside a HAML file or it would be redundant(?): #navigation %p <?php include("navigation.html"); ?> ...

Is it possible to "watch" Haml files in Compass (stylesheet authoring tool)?

Currently, Compass is watching the .scss files inside the src folder and automatically updating the cs files. (by typing compass watch myproject). Is there any way of including haml files in the "watching process"? (I couldn't install StaticMatic because I don't want to install Ruby1.8). ...

Is there an easy way of interpreting PHP code within an HAML file?

Currently this is how I write a php file using Haml: %ul#nav %li %a <?php echo l('nav1'); ?> Output: <ul id="nav"> <li><a><?php echo l('nav1'); ?></a></li> I which I could have something like this: %ul#nav %li %a=$nav1 I checked pHaml and phpHaml but coudn't figure out how to use it, and I saw th...

Php file renders blank after being converted with Haml (Ruby)!

In order to test if the converted index.haml would work on with my wamp and localhost i did the following: First, I renamed my index.php into index.html Then, I typed html2haml index.html index.haml in the command line Then, I typed haml index.haml indexnew.html in the command line I renamed indexnew.html to indexnew.php I tested it: l...

HAML select helper not ordering options correctly

Hello all, I'm trying to get some forms out, but I'm having trouble, in that HAML is not ordering the options in my select elements properly. Here is my echo statement: =select 'user', @empty_data, {"Less than $40k" => 1, "$40k - $70k" => 2, "$70k - $100k" => 3, "$100k+" => 4, "No Thanks" => 5 } However, when the HTML gets rendered,...

Installing haml/sass through rubygems

meder@dunross:~$ sudo gem install haml Successfully installed haml-3.0.12 1 gem installed Installing ri documentation for haml-3.0.12... Installing RDoc documentation for haml-3.0.12... Could not find main page README.rdoc Could not find main page README.rdoc Could not find main page README.rdoc Could not find main page README.rdoc meder...