Questions tagged [slim-lang]

Slim is a lightweight template engine for Ruby whose goal is reduce the syntax to the essential parts without becoming cryptic.

Slim is a template language whose goal is reduce the syntax to the essential parts without becoming cryptic.

The initial design of Slim is what you see on the home page. It started as an exercise to see how much could be removed from a standard html template (<, >, closing tags, etc...). As more people took an interest in Slim, the functionality grew and so did the flexibility of the syntax.

Slim will strive to maintain simplicity, but not everyone's definition of a readable syntax is the same. The docs will show you the options.

Slim uses Temple and Tilt. If you want to learn how Slim works, you'll need to study these projects.

Source: Slim-lang.com (About)

681 questions
8
votes
2 answers

Aptana Studio 3 Slim support

I am use Aptana Studio 3 for Ruby on Rails development. The project I am working on uses Slim (http://slim-lang.com/). I was hoping to find editor and formatting support for the slim file type. So far my Google search have some up empty.
user1607483
  • 143
  • 5
8
votes
1 answer

Using Slim or Haml & Sass / SCSS with Node.js?

I have a rather robust project that has all of its templates implemented in Slim and a little Haml. I'm considering moving the project over to a Node.js based structure (probably built atop Tower.js or something similar; maybe Meteor), however I…
ylluminate
  • 12,102
  • 17
  • 78
  • 152
7
votes
1 answer

Slim SyntaxError

I decided to try slim template engine, but I have strange error. ActionView::Template::Error (Unknown line indicator app/views/layouts/application.html.slim, Line 1 ^ ): slim (1.1.1) lib/slim/parser.rb:448:in…
Donotello
  • 496
  • 5
  • 12
7
votes
4 answers

Slim template engine syntax for [if lt IE 9

I use slim as view template engine http://slim-lang.com/ How would you write the following piece of code with slim? thanks
denisjacquemin
  • 7,414
  • 10
  • 55
  • 72
7
votes
3 answers

Ruby on Rails - SLIM - SCSS - inject ruby variable

How do I set a SCSS variable based on ruby variable value? Following code is working for CSS but not for SCSS: - primaryColor = app.theme_variables['primary-color']; = content_for(:after_head_script) do css: .primaryColor { color:…
Gapipro
  • 1,913
  • 2
  • 22
  • 34
7
votes
4 answers

SLIM add space at start of multi line

I am trying to add a space to the start of my slim template where I have had to break the text due to a link, I cant for the life of me work this one out .mdl-cell.mdl-cell--4-col-phone.mdl-cell--8-col-tablet.mdl-cell--12-col-desktop | Don't have…
Boss Nass
  • 3,384
  • 9
  • 48
  • 90
7
votes
2 answers

How to use slim for mailer text template

I am using slim as the template engine for my rails app and would like to use slim for mailer templates as well. There is no problem with html mailer templates (views/mailer/default_email.en.html.slim) but, I am not sure how to make the text…
DannyB
  • 12,810
  • 5
  • 55
  • 65
7
votes
0 answers

Is it possible to use SLIM with ReactJs both together

There is a classic React component: var CommentForm = React.createClass({ render: function() { return (
user1476061
7
votes
4 answers

What to name a SLIM file? .slim? .html.slim?

Sorry for such a silly question, but couldn't find it on the docs: filename.slim filename.html.slim This seems like a really great language to work with. I've used HAML before, so I think this will be a fairly nice transition.
rikkitikkitumbo
  • 954
  • 3
  • 17
  • 38
7
votes
2 answers

Ruby Each loop in Slim

I want to be able to loop through an instance var through a javascript but I'm not quite sure how to make it work. javascript: -@spots.each do |spot| map.addMarker({ lat: "#{spot.latitude}", lng: "#{spot.longitude}", …
trigun0x2
  • 233
  • 3
  • 13
7
votes
4 answers

Precompile slim templates using the rails asset pipeline

It would be super handy if I could precompile slim templates using the rails asset pipeline. I was hoping to stick my templates in app/assets/html and serve them up that way. Here's what I've got so far: #…
Jimmy Baker
  • 3,215
  • 1
  • 24
  • 26
6
votes
1 answer

How to do a multi-line class attribute with slim-rails?

Element needs a lot of class attributes but I don't want them to be chucked in one line, as the line length will be too long and it would require heavy side scrolling. Preferably, I don't want to use the delimiter syntax [class= ""] as this syntax…
jemonsanto
  • 513
  • 8
  • 19
6
votes
1 answer

Set Javascript Type in Ruby Slim File

I have a Ruby on Rails application with mailers that use slim for the views. I want to mark up an email with the Google markup format. It calls for a script tag with the type of JSON-LD, like this: