Все вопросы: [haml]

53 вопросов

похожие теги:
0
голосов
1ответов
139 просмотров

I have a problem in linking a stand with two checkboxes owner communication and resident communication

I have a problem in trying to link a stand with two checkboxes which are resident & communication, and they seem to be stored separately if more than one stand is choosen. If I have one stand the parameters seem to be stored in the correct manner inside a hash of an array, but once I add ano...

0
голосов
1ответов
837 просмотров

HAML & RoR: Auto-convert apostrophes, etc., to ASCII HTML entities?

Is there anyway to have HAML automatically convert all my apostrophe's ' to the HTML character entity equivalents ’ (’)? Ditto with all the other characters that one would want to convert (dashes, double-quotes, etc.) for better online readability. ?

3
голосов
2ответов
4940 просмотров

Load jQuery through Google API in Rails using HAML?

This feels like it should be pretty simple, but not much seems to be loading. I have this in my app/views/layouts/application.html.haml: = javascript_include_tag 'http://www.google.com/jsapi' %script{ :type => "text/javascript", :charset => "utf-8" } //<![CDATA[ google.load("jquery...

2
голосов
4ответов
1005 просмотров

Using webrat's contain(text) matcher with haml

I'm using the following webrat matcher: response.should contain(text) With the following haml: %p You have = current_user.credits credits I've written the cucumber step 'Then I should see "You have 10 credits"', which uses the webrat matcher above. The step fails, webrat does not fin...

5
голосов
2ответов
2146 просмотров

Is it possible to have Haml indent HTML generated by a view helper in Rails?

Say I have a things resource with a view helper method such as: module ThingsHelper def foo ret = "" 3.times { ret += content_tag(:li, "foo") } content_tag(:ul, ret) end end This, then, is used in a template: %p = foo The HTML source that's generated looks like this: &lt...

0
голосов
2ответов
301 просмотров

HAML throwing exception on Production but not Development

I've written this HAML: %script{:src => "http://www.google.com/jsapi?key=mykey" :type => "text/javascript"} Note the missing comma between :src and :type. On my Production server (Dreamhost/Linux), I get the following logged exception when I try to view the page: ActionView::TemplateEr...

19
голосов
4ответов
25703 просмотров

Multiple multi-line HAML blocks

Using the (intentionally) strange multi-line format for HAML, I'd like to have the following lines in my template: = call_to_helper :foo1 => 'bar1', :foo2 => 'bar2', :foo3 => 'bar3', | :foo4 => 'bar4', :foo5 => 'bar5' | -# and = call_to_helper :foo1 => 'bar1', :foo2 => '...

40
голосов
6ответов
28025 просмотров

Using Haml & Sass with Eclipse

Are there any plugins for eclipse that add syntax highlighting and other niceties for editing Haml and Sass? Google searches only seem to point to a dead project on lucky-dip.net. Note: it's Sass I'm most interested in. A solution for using just Sass (or something similar to it like less) in Ecl...

13
голосов
7ответов
6451 просмотров

Even better support for HAML in Netbeans?

This plugin is pretty good, definitely better than plain-text.. but I'm longing for a little more. Code completion, the Netbeans code generator shortcuts, 'ri' integration for looking up documentation like the .erb files have.. Does anyone have some tricks, is there a different plugin for this t...

1
голосов
3ответов
1521 просмотров

if else error

This is my code. I have a problem with spaces. I can not get the proper generation - if @lastday.nil? && @lastday != item.created_at.strftime("%d %b %Y") .daily-entry %h1.date =h item.created_at.strftime("%d") %span =h item.created_at.strftime("%b, %Y") -else ...

6
голосов
3ответов
3864 просмотров

=button_to does not generates form if already in an other form

Using the same form partial in both create and edit in my case new and preview. partial looks somewhat like this (I use HAML) =form_tag ({:action => params[:action]}, :multipart => true) =text_field :newsletter, :title =text_area :newsletter, :body =file_field :newsletter,:attachmen...

2
голосов
2ответов
3574 просмотров

ActionView::MissingTemplate with HAML

I'm getting Ruby on Rails set up on a fresh installation of Snow Leopard. After battling (and beating) MySQL and Sphinx problems, I'm stuck on a stupid error related to HAML. Essentially I'm getting a missing template error for every view that uses HAML. I can add a blank xxx.html.erb file and a...

3
голосов
2ответов
1080 просмотров

HAML Inheritance

I am new to haml and want to do some inheritance, but I don't know whether it is possible with haml or not. I have 2 separate haml files as below === file1.haml %p This is haml1 === file2.haml %h1 This is haml2 *** I want to have a file.haml which inherit from file1.haml and file2.h...

4
голосов
1ответов
2476 просмотров

How can I keep a div's scrollbar at the bottom of the div using jQuery?

I have a div called #output, styled with overflow: scroll;. Using jQuery.ajax, it's being updated every x second. I'd like to have it so that when the scrollbar appears (after the divs filled up), it should continously stay at the bottom of the div instead of the top, like most chat clients do. ...

9
голосов
5ответов
4341 просмотров

Rendering HAML partials from within HAML outside of Rails

I'm using HAML to generate some static html pages for a site, and I was wanting to split out common components into partials that I can include in multiple pages, just like in Rails. However I don't want to use the whole Rails stack to do this as it seems like overkill. I've looked around on the...

0
голосов
3ответов
532 просмотров

Is there a way to write a single expression over multiple lines in haml?

I have this in one of my haml views: -form_for :news_item_comment, :url=>{:id => comment.id, :controller => 'comment' , :action => 'add_comment'}, :html => {:id => "form-#{comment.id}"} do |f| ... Since it's really long and hard to read I want to split it over 2 lines...

5
голосов
3ответов
920 просмотров

refactor conditions within haml view

beside the fact that accessibility standards discourage the use of a link pointing to the current page, how I am supposed to refactor the following view code? #navigation %ul.tabbed - if current_page?(new_profile_path) %li{:class => "current_page_item"} = link_to t("new_p...

12
голосов
4ответов
8767 просмотров

Haml/Sass Syntax Highlighting in Notepad++?

Has anybody made this yet?

97
голосов
13ответов
38649 просмотров

Haml: Control whitespace around text

In my Rails template, I'd like to accomplish final HTML to this effect using HAML: I will first <a href="http://example.com">link somewhere</a>, then render this half of the sentence if a condition is met The template that comes close: I will first = link_to 'link somewhere', 'htt...

3
голосов
3ответов
4014 просмотров

Rails -- How to save HTML output of a HAML partial as a string to send to an external service?

Hey guys, first post here, hope you can help me out. We're generating a newsletter automatically every 24 hours using a rake task. There's a section at the top of the newsletter where an admin can put a customized message. The screen that the admin uses has a live preview of the newsletter (th...

2
голосов
3ответов
1002 просмотров

Very strange problem with Gettext and Haml on Rails / rake updatepo broke

I'm on Rails 2.3.3 and using Haml 2.0.9 for my templates and Gettext-Rails 2.0.4 for the translation. Haml works like a charm and gettext is also working like it should. But I cant get Gettext to parse Haml Files when using "rake updatepo". I created a custom parser like this: # lib/haml_parser...

0
голосов
1ответов
167 просмотров

Rails duplicating view

I'm trying to display all @user.notes on my index action of the user_controller, and provide a form below to add a new note, inline. Pretty simple code that I've gleaned from a few tutorials, but what's happening is my view is completely duplicated. It spits out 2 copies of the same html. Still...

2
голосов
3ответов
1553 просмотров

Passing options to Haml on the command line

I'm using Haml from the command-line to do a basic transform of one .haml file to .html, like this: > haml input.haml output.html Thing is, this produces single-quotes around attributes in the resulting HTML. So how to I pass in the :attr_wrapper => '"' option from the command-line? Alt...

60
голосов
1ответов
45279 просмотров

How do I make an image link tag using haml in Rails?

I have something like this in application.html.haml: #header = image_tag("header.jpg") How do I make that link to www.google.com, for example? Thanks

11
голосов
3ответов
14213 просмотров

ERB vs HAML conversion of an if condition?

I am getting started with HAML and am working on my converting my first file. The ostensibly correct omission of the "- end": - if current_user = link_to 'Edit Profile', edit_user_path(current_user.id) = link_to 'Logout', logout_path - else = link_to 'Register', new_user_path = link_to 'Login', ...

-2
голосов
2ответов
437 просмотров

Pair of blocks in each?

As in the standart cycle: - @goods.each do |good| ??? ...to organize this (HAML): .columns-wrapper .column First good .column Second good .column Third good .columns-wrapper .column Fourth good .column Fifth good .column Sixth good

3
голосов
11ответов
6970 просмотров

Rails 2.3.2 trying to render ERB instead of HAML

Rails is suddenly trying to render ERB instead of Haml and I can't figure out why. I've created new rails projects, reinstalled Haml, and reinstalled Rails. Here's exactly the steps I take when making my application (Rails 2.3.2): rails> rails test rails> cd test rails\test> haml...

2
голосов
1ответов
552 просмотров

Требуются ли HAML и Sass для работы с Compass?

Насколько взаимозависимы Haml, Sass и Compass? Все три требуются в проекте Compass?

3
голосов
2ответов
4887 просмотров

Как написать tr: nth-child (odd) в Sass?

Этот код sass действителен? tr:nth-child(odd) :background-color #cccccc Почему-то он не окрашивает чередующиеся строки моей таблицы.

0
голосов
3ответов
910 просмотров

у моих рельсов ApplicationController есть RoutingError

Я ни в коем случае не являюсь Ruby-разработчиком, но я кодирую HAML для Ruby framework на моем локальном хосте. Изначально я поместил файл с именем vidgirlBox2.flv и вызвал его в HAML, но преобразовал файл в swf-файл с именем vidGirl_home.swf. Этот swf работал. Пока я не внес простое из...