haml

Possible to "watch" both HAML and SASS at the same time?

I'd like to be able to update/save both my html and css on-the-fly, but I can't figure out how to watch both HAML and SASS at the same time. Thanks! ...

Rails helpers shortcuts with HAML bundle

Hi guys, I've started using HAML, and everything rocks except that I cannot get my old helper shortcuts in TextMate when creating HAML templates. I've installed the HAML bundle, but it doesn't seem to support those shortcuts (like rp => render :partial). Is there any way out of this? Thanks a lot. ...

Ruby on Rails or programmatically generated <span> or <img>, each on a line, causing spaces in between when displayed

When using Ruby on Rails or other framework, a lot of time we generate <span> or <img> in a loop, and each line will be on a new line. So when it is rendered in HTML, there will be extra space between those inline elements. How can it be solved? Must they be made into 1 long line, or solvable using HTML or CSS? ...

Working on my first json from scratch and I can't seem to figure this simple part out..

HAML: = link_to 'redeem', redeem_admin_organization_path(organization), :class => 'button_short live redeem' Controller: def redeem @organization = Organization.find(params[:id]) @organization.update_attribute('accumulated_credits', '0') end redeem.js.haml: == $("#organization_#{@organization.id} .redeem").html("#{escape_javas...

HAML White space removal only on the "inside lines" within a loop (Ruby on Rails)

To generate <span> or inline elements using a loop, so that the result has no white space between them: %div - 5.times do %span> hello the above will create <div><span>hello</span><span>hello</span><span>hello</span><span>hello</span><span>hello</span></div> (practically, it is no use to stick "hello" together, but say, if we...

SASS error: Properties arent allowed at the root of a document?

I keep getting an error like this: Sass::SyntaxError: Properties aren't allowed at the root of a document. on line 2 of /Users/eumir/rails_apps/neo2/public/stylesheets/sass/ main.sass main.sass's line 2 starts with @import mixins I have a _mixins.sass which has a variable declaration on line 2: $alt_site_color: #060 $main_s...

Rails 3 renders Haml file as Html

Following the guide at http://github.com/fortuity/rails3-mongoid-devise I've managed to setup Rails3 with Haml, Devise, and Mongoid. (As a side-note, the guide is really detailed; recommended reading for new Rails users!) Only problem is I can't get Rails to render my Haml views: Started GET "/" for 127.0.0.1 at 2010-07-01 14:40:23 +02...

Can I render a haml template with Ruby on Rails metal?

I have metal working (thanks to Railscasts), but I have a haml template that I want to render instead of just plain text. Apparently you can render ERB , but I don't see any place to do the same with haml. Is it possible or will I just have to live with using the plain rails routing if I want to continue using haml? Thanks! ...

haml documentation - where is it?

Hi there I've just started with Rails (having previously worked in Django). The hardest part is working out how to use haml. I have found the official haml documentation. However, there seems to be no coverage here of syntax - if/else clauses, for loops, etc. Other than Googling for examples, is there any official documentation of sy...

haml: Incredibly basic question

In haml, how do I render the following incredibly basic HTML: <p>Results found for <strong>search term</strong> where 'search term' is actually a Ruby variable called @query? I'm trying the following, %p results found for <strong>= @query</strong> But that renders = @query literally. If I try: %p results found for <strong> = @qu...

How do I work with checkboxes with DataMapper and Sinatra?

I'm trying to make a simple room management service. The rooms have these properties: class Room include DataMapper::Resource validates_is_unique :number property :id, Serial property :number, Integer property :guest, String property :status, Enum[ :free, :occupied ], :default => :free end Then I create a new room like th...

Why is my textarea input not accepting input?

When I insert a new text_area input(created by rails) into an existing form with jQuery it doesn't allow the user to type in the box, but the text_field(also created by rails) input field does. -form_tag user_posts_path do [email protected]_with_index do |post,index| -semantic_fields_for "posts[#{index}]", post do |f| =re...

Proper embedded Ruby Code writing

I am trying to write this : %meta{ :name => "keywords", :content => "#{@page_city}, #{truncate_words(@page_keywords, 7) || 'Meta, Words, Are, Dope, For, SEO'}"} Basically it sees if there is a local page that has a page city or keywords and adds those as they meta keywords. If it doesn't, it says the latter. This works, but the onl...

Safari/Chrome does not understand jQuery focus/blur on check boxes..

Here's my javascript: $(".more_info").hide(); $(".checkbox.has_info, .has_info").focus(function(){ $(this).parent().next().next().show("fast"); }); $(".checkbox.has_info, .has_info").blur(function(){ $(this).parent().next().next().hide("fast"); }); Note, that this works perfectly in Firefox/ IE7, IE8. So far I have discovered th...

Trying to create Template::Plugin::Filter for Haml

I'm trying to create a cpan module that integrates Text::Haml into Template Toolkit. I think that Haml is an interesting templating language but rather limited, it doesn't support loops or conditionals let alone more advanced things. But I can't seem to get eve a very simple version to work. The following are some test scripts that work ...

Rails: SASS not creating the CSS files

SASS is not creating the CSS files, but HAML is working just fine. I ran the following command: $: sass --watch scss:stylesheets [true, ["scss", "stylesheets"]] My main.scss file contains the following: /* main.scss */ body { background: #000000; } The main.css file never gets generated. So I ran the following: $: sass --upd...

Is there any haml highlight plugin of eclipse

I'm editing haml in eclipse, but it has no highlight. I don't want to use "radrails" plugin of eclipse just for this(it's too huge) I found a plugin named EclipseColorer, looks nice but doesn't work on windows. I hope there is a plugin like that can work on windows, but not found. Is there any plugin can highlight haml in eclipse? Than...

Netbeans 6.9 support for HAML and SASS?

It doesn't seem to be any HAML and SASS support in Netbeans 6.9. Is there a way to add this support? Thanks ...

Rails subset select always returns true

First: Sorry for the ambiguous question, I'm not fully versed on Rails parlance yet. I am trying to search a dataset for a value. If the dataset contains the value, I'd like the app to do something. If it doesn't, the app needs to do something else. The data breaks down like this: I have affiliates and users, each with a HABTM relati...

[Rails3] jQuery + Ajax + Haml. js.erb files not firing.

After reading up on a few experiences, I feel this issue might need to be brought up again. Coding in Rails3, I'm trying to implement some smooth Ajax effects when a user tries to create a post on another element of my app. Here's the code I'm concerned with: app/views/posts/new.html.haml - form_for @post, :remote=>true do |f| = ...