NoMethodError in course_templates#index
Showing app/views/course_templates/index.haml where line #6 raised:
undefined method `new_course_template' for #<ActionView::Base:0x237c3e4>
Extracted source (around line #6):
3: - content_for :sidebar do
4: %ul.links
5: %li= link_to "Add a Template", new_course_template(@provider) ...
I'm trying to figure out the cleanest way to generate a bit of html AND nest content inside it. Using HAML. Basically I want to do something like:
= block_large
This is some nested content
And that should generate:
<div class="block large">
<img src="block_large_carat.gif" class="block_large_carat">
This is some nested content...
What I want is both whats in "if" and whats in "else" to include #main-block.
- if @transparency
#content-inner{:style => "background: url(../../../images/illustrations/" + @transparency + ") no-repeat 88% 50%"}
- else
#content-inner
#main-block
What happens currently is, if @transparency is defined, #main-block is not neste...
There must be a better way of writing this- I'm just not sure how (using staticmatic)-
- if current_page.include? "0.html"
- @current_index = 1
- if current_page.include? "1.html"
- @current_index = 2
- if current_page.include? "2.html"
- @current_index = 3
- if current_page.include? "3.html"
- @current_index = 4
- if current_pa...
I have a config file full of this....
- if current_page.include? "test_string_one"
- @total_index = 3
- @next_location = '../random_string/page0.html'
- @next_name = 'title 2'
- if current_page.include? "test_string_two"
- @total_index = 10
- @next_location = '../another_random_string/page0.html'
...
I'm a rails newbie, I've been trying to figure out what is going on with the stylesheets_link_tag on heroku.
If I use
= stylesheet_link_tag "style", :cache => true
heroku uses "all.css" and does not pick up the stylesheet, but if I use
= stylesheet_link_tag "style", :cache => false
it serves the stylesheet using its name "style.c...
How do I reference a .sass file from a .haml file?
I have the following haml expression that will reference a .css file:
%link{'href' => '/stylesheets/layout.css?cache=1', 'rel' => 'stylesheet', 'type' => 'text/css'}/
How do I reference a .sass file?
...
Is it possible to use Haml instead of a templating engine with the Catalyst web framework?
...
Is anyone using a HAML implementation for PHP like phpHaml or pHAML? Both projects have seen no activity for about 2 years, and both are < 1.0. Is it feasible/wise to use HAML for a large PHP application, or is it too immature?
Does anybody have experience with Chaml for CakePHP? I played around with it, and it seems to be really picky ...
I only want to output one anchor here. If the current_page is in the array I get two (.html and -nf.html). If it is not in the array I get as many anchors as there are items in the array.
I am using StaticMatic.
- if page_options[:current_index] < page_options[:total_index] && page_options[:current_index] > 0
// loop through the ...
I'm using rails.vim and I love how you can use ctrl-x ctrl-u in insert mode to autocomplete long method names like distance_of_time_in_words and accepts_nested_attributes_for. But for some reason it doesn't work in haml files and I can't seem to figure out what's wrong or how to fix it.
:help i_CTRL-X_CTRL-U says the autocompletion is u...
what i want is a way of nesting partial properties, this seems a tad long winded:
= partial('frames/tabs_a', :locals => {:tabs_title => 'semi-dynamic-tabs',
:tabs_id => 'p001',
:panel_a => 'views/article-highlights_a',
:a_id => 'p_002_0',
:a_ft => '123 More in highlights',
:a_tt => 'panel a',
:a_c => 'magazine',
:panel_b...
wondering if it is possible to use an array with Sass as I find my self repeating the following sort of thing:
.donkey
h2
background-color= !donkey
.giraffe
h2
background-color= !giraffe
.iguana
h2
background-color= !iguana
...
I often want some html like this:
(<span id="items_shown">all</span> items shown)
which I end up getting by using haml like this:
%span><
(
%span#items_shown><
all
%span
items shown)
Note that I end up having to create extra spans, and then having to control for the whitespace around those spans, in order to get the exact syn...
I have a small rails app I got all gung-ho on tonight wanting to convert all the erb to haml templates. The Haml docs suggest running haml --rails /path/to/app to install it as a plugin (using the gem already installed on the system).
Unfortunately, when I attempt to start the webserver for rails, I receive the following error:
/code/s...
I have written a simple custom filter in HAML but I cannot get my Rails app to find it.
The filter looks like this:
# lib/haml/filters/gfmarkdown.rb
module Haml::Filters::Gfmarkdown
include Haml::Filters::Base
# copied from Haml::Filters::Markdown
lazy_require 'rdiscount', 'peg_markdown', 'maruku', 'bluecloth'
def render(text...
I'm getting an InvalidAuthenticityToken despite adding in corresponding authenticity tokens in the jquery response. Is there an error in the code, or is there another, root problem? I appreciate any comments. Thanks!
Using:
Rails 2.3.3, Ruby 1.8.6, Webrick, JQuery 1.3.2
layout/networks.html.haml
= token_tag
= javascript_tag "window.AU...
Hi, all.
I've developed custom filters for HAML (http://github.com/alec-c4/cb-haml-filters) and have a small problem with textile and maruku. Maybe you can help me with this
Problem with textile
with code
%h2 Textile test
:cbtextile
h4. YouTube video
http://www.youtube.com/watch?v=0_IXrjqKbE4&feature=player_embedded
...
I have problem with <pre>, here is my code, please check my screenshot attached, how to remove those indents?
%pre.code
:escaped
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head></head>
<body>...
I'm looking for a javascript 'port' of haml supporting the following features:
Templates stored in files.
JSON input.
Supports "collections" [{Booking},{Booking},{Booking}] for iterated processing.
Essentially I'd like the functionality as sinatra_more's templates.
Does anyone know of something that fits the bill?
...