haml

Error: Class 'Haml' not found... trying to use Haml (Kohaml) with Kohana

Can't for the life of me figure out what I'm doing wrong... Downloaded Kohaml from http://github.com/transphorm/kohaml Dropped it into modules/kohaml # My Bootstrap reference 'kohaml' => MODPATH.'kohaml', // kohaml Keep getting this error... (snapshot of the error and my modules folder) http://wellcommentedcode.com/st...

How to change color of HAML tags in NetBeans?

I use Aloha theme in NetBeans 6.8, everything looks cool except these blue tags in HAML files, which are unreadable. How to find a place where this blue color could be changed? P.S. I use that HAML plugin which seems to be unsupported and lacks features Screenshot: http://img.leprosorium.com/846904 (sorry, new users can't embed images)...

Execute ruby code in a link in Haml

I want to have a "delete user" link in a normal Activerecord table, but I can't figure out how to wrangle the inline ruby in haml. I have this: %tbody - @users.each do |user| %tr %td= user.name %td= user.login %td %a %img{:src => '../images/delete.png', :title => 'Delete user'}...

Rails 3 Beta 2, Haml, Nested Layouts and LocalJumpError

Alright, I'm trying to create an app with nested templates. I'm using Rails 3 Beta 2 and Haml. I've poked around and I've decided to take the clearest approach and have structured my templates like so: # application.html.haml !!! %body %h1 Outermost Template = yield(:foobar) # inner.html.haml - content_for :foobar do %h2 Inner Te...

How do I make Rack::Reloader re-load changes to haml files?

My jruby rack sinatra compass haml app correctly reloads changes to *.rb files, but does not detect changes to *.haml files. Is this compass doing some caching or a limitation of Rack::Reloader? Any pointers to how to fix? ...

Ruby methods within Javascript within HAML

I have a jQuery script that adds a new field to a form, and this field contains dynamic information from an array. The problem is that I can't figure out how to add an array.each to populate the options of the select field within the javascript without breaking the HAML indentation and causing errors. Here is my best attempt that does n...

Looking For A Good HTML Templater for PHP

That's an HTML templater, not a php templater, not java or whatever. I am looking for something like HAML for PHP. I tried the 2 projects for PHP, PHAML and PHPHaml both of which are suffering from serious bugs. Do you know of any good html templater out there, preferably for PHP? EDIT I''m looking for something that can turn this <...

2 Spaces or 1 Tab, what's the standard for indentation in the Rails Community?

I've noticed that most of the HTML/XML/HAML that gets generated from plugins uses 2 spaces instead of 1 tab. I use textmate and have tabs set to 4 spaces for HAML/HTML/XML and 2 spaces for Javascript/Ruby, but I only have to press the tab key once to get nice indentation. Pressing the space bar twice and delete twice seems like too muc...

Haml - if-else with different identations

I'm trying to render a calendar with Rails and Haml. The dates used come from a variable called @dates. It is a Date range that contains the first and last days to be presented on the calendar. The first day is always Sunday and the last one is always Monday. I'm planning to render a typical calendar, with one column per weekday (Sunda...

unexpected kENSURE, expecting $end - Rails/Cucumber/Haml

Been having a problem with Rails/Cucumber/Haml. The below Haml file works perfectly in the development and live environments but fails in Cucumber with the following error: /app/views/competitions/show.haml:30: syntax error, unexpected kENSURE, expecting $end (ActionView::TemplateError) On line #30 of app/views/competitions/show.haml ...

Should I learn Sass?

I do a lot of design work with XHTML, CSS, and PHP. A friend mentioned Sass to me and it looks pretty cool. I don't know anything about Ruby or Rails and I am running a windows machine. Does anyone know a good tutorial for a beginner to dig in to something like this? ...

html.erb vs erb (and haml equivalents)

I'm not sure I understand the difference between the html.erb files and erb files in the views for a Ruby on Rails application. (Similarly for haml files.) What are the dis/advantages of each (html.erb/haml or erb/haml) files? PS I'm not asking about the difference between the erb and haml files -- just appending the extension to an ht...

Haml formatting

I'm new to haml, so I'm still trying to figure out the formatting. I have an index.haml file with the following code. %h1 Welcome to Solidarity Hello, = @profile.first_name ! It renders like this: Welcome to SolidarityHello, user ! Here's the page source: <h1> Welcome to Solidarity </h1> Hello, frances ! It has a space...

CSS IDs and nesting tags with Haml

I have the following code in my CSS file, which isn't working. #home table th td { border:1px solid black; padding:2px; } In my index.haml file, I have: %div{:id => "home"} %table %tr %th Your Account %tr %td #{link_to 'View my profile', @profile} %br #{link_to 'Edit my profil...

Using Rails 3 and Haml 3, how do I configure Haml?

I'm using Rails 3.0.0.beta3 and Haml 3.0.0.rc.2, and I can't find where I need to place the configuration lines for Haml (nor what they are in the new version, for that matter). Using Rails 2.3.5 and Haml 2, I would do Haml::Template.options[:format] = :html5 in environment.rb. Or, in Sinatra, set :haml, {:format => :html5} in my m...

Validate HAML from ActiveRecord: scope/controller/helpers for link_to etc?

I like HAML. So much, in fact, that in my first Rails app, which is the usual blog/CMS thing, I want to render the body of my Page model using HAML (obviously I won't do the same for Comment!). So here is app/views/pages/_body.html.haml: .entry-content= Haml::Engine.new(body, :format => :html5).render(self) ...and it works (yay, recur...

Keeping user data persistent after validates_presence_of

I'm designing a question-and-answer Ruby on Rails application. After a user logs in, you can see a list of questions posed by other users. I have a link next to each of the questions to /answers/new?question_id=someNumber. That links to a page that displays the question (to remind the "answerer") above a standard form for submitting you...

Redirecting users after destroy

I have 3 models: Questions, Answers, and Profiles (I know, it should be called "Users"). When you view a question Q, I query the database for the answers to Q. (They are linked by id.) In the view, the current user has the option to delete his answer by clicking on the destroy link displayed next to his answer: %table %tr %td ...

Node.js/Express Partials problem: Can't be nested too deep?

I'm learning Node.js, Express, haml.js and liking it. I've run into a prety annoying problem though. I'm pretty new to this but have been getting nice results so far. I'm writing a jquery heavy web app that relies on a table containing divs. The divs slide around, switch back and fourth and are resized etc to my hearts content. What I...

rails 2.3.4 "Template is missing" when using haml

How to make it work? I have a file index.html.haml and a index.html.erb. the erb one works, then when i delete the erb, it gives me the template is missing error. I have rails 2.3.4 and installed the haml gem. "Template is missing Missing template profiles/index.erb in view path app/views" ...