Questions tagged [hamlc]

JavaScript templating using HAML and CoffeeScript.

Haml Coffee is a JavaScript template solution (JST) that uses HAML for markup and inline CoffeeScript for the logic. It's used to dynamically create HTML code from JavaScript and is often used in Single-Page Applications.

25 questions
0
votes
1 answer

HAML-Coffee Template Links not opening

This is a ridiculous issue, but for some reason, in my Backbone app, external links are being treated as internal ones, simply appended to the url. Here's my .hamlc file snippet: .row %li.modal-annotation-text.marginb-10 %a{ href:…
Andrew
  • 375
  • 2
  • 12
0
votes
1 answer

Are hamlc files still necessary in haml 4x+?

Our app was previously using haml 3.1.x and haml-coffee, and have now upgraded to 4.0.x. We have hamlc templates, and we were using haml-coffee-assets gem. Do we still need hamlc files, and will they still transpile properly, or do I need to get…
Mike Earley
  • 1,223
  • 4
  • 20
  • 47
0
votes
1 answer

how do I use rails time_ago_in_words in backbone template

Is there a way to use rails standard methods such as time_ago_in_words in backbone template also using hamlc ? When I tried this .created_at= time_ago_in_words e.created_at It throws an exception Uncaught ReferenceError: time_ago_in_words is not…
0
votes
2 answers

How to comment out a line in HAMLC comment

Wondering how to comment out one line in HAMLC. I Tried # this is commented out But it doesn't work. It creates a
this is commented out
Can't find many resources on HAMLC. Knowing how to comment out multi-line would also be…
Antoine
  • 1,206
  • 16
  • 19
0
votes
2 answers

Parse object to attribute-value with hamlc

I am using CoffeeScript and HAML. I have objects list: { title: "Title" url: "http://example.com" image_url: "img.png" attributes: { target: '_blank' } } { // ... } And I have a template: - for item in @model.data …
acidernt
  • 2,173
  • 2
  • 19
  • 33
0
votes
1 answer

How do I remove white space between link and period in hamlc

Here is my hamlc code: %a{href: 'http://www.google.com'} hello \. This results in the following output: hello . The line break results in a space between the link and the period. How can I avoid this?
ek_ny
  • 10,153
  • 6
  • 47
  • 60
0
votes
2 answers

Rails/Backbone.js content with script tag shows error "Uncaught SyntaxError: Unexpected token ILLEGAL"

I have an app that has page content that includes script tags, but when it tries to render it gives the error 'Uncaught SyntaxError: Unexpected token ILLEGAL'. I'm initializing a backbone app as follows: - content_for :javascript do -…
jake
  • 1,635
  • 2
  • 20
  • 30
0
votes
2 answers

Nodejs Backbone Templates

I have worked a lot with rails, requirejs and backbone and know how to use haml coffee templates in rails. App = new Backbone.Marionette.Application() App.addInitializer (options) -> Backbone.history.start() alert "yay" $ -> alert "yay" …
user1323136
  • 889
  • 2
  • 11
  • 20
0
votes
1 answer

Extracting plain text from an html content variable in HAML

I'm trying to extract the plain text from some HTML content in HAML. For example, if I have this HTML in a variable called message.content: Hi, this is a test message! I have a HAML line like this: %p= message.content And I want…
mojarras
  • 1,624
  • 2
  • 11
  • 9
0
votes
2 answers

Haml Coffee Assets Template Error, no access to Backbone JS model?

I'm using haml_coffee_assets in a Rails 3.2 application. The following works in an ejs template: <% tutorials.each(function(model) { %> <% });…
Dylan
  • 3,658
  • 1
  • 21
  • 12
1
2
<%= model.escape('title') %>