Top "Slim-lang" questions

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

Dynamic class name

How to generate dynamic class name? li v-for='obj in objs' | {{ obj.id }} {{ obj.title }} div id="obj-{{ obj.id }} " …

vue.js slim-lang
erb, haml or slim: which one do you suggest? And why?

I am learning Rails and I have seen these template engines. I have no experience with them (only erb). But …

ruby-on-rails haml erb slim-lang
How to access instance variables in CoffeeScript engine inside a Slim template

I have a Rails controller in which I am setting a instance variable - @user_name = "Some Username" In my .…

ruby-on-rails ruby-on-rails-3 coffeescript haml slim-lang
slim dynamic conditional class

Just to help other developers, because there is no similar question on SO. div class=(is_active? ? 'active' : 'inactive') div …

ruby-on-rails slim-lang
ruby inside javascript block [slim template]

There is a way to put ruby conditions inside javascript block? i.e. javascript: var config = { common_value_1 : 1, common_value_2 : 2 }; …

ruby slim-lang
How to embed dynamic Ruby code to "javascript" section in Slim templates?

One way: javascript_tag do == "var all_product_ids = #{existing_ids.to_json};" == "var products_json = #{@filter.data.to_json};" …

ruby-on-rails ruby slim-lang
Best way to handle data attributes in Slim

I was evaluating Slim as a replacement for HAML in a personal project, and it doesn't appear to handle HTML5 …

ruby-on-rails ruby haml templating slim-lang
Ruby Slim - How do you define an element's class with a rails helper or variable?

In rails slim (http://slim-lang.com/) the syntax for defining a new div with a class name "sample" is the …

html css ruby-on-rails ruby-on-rails-3 slim-lang
How to render HTML inside Slim templates

I'm trying to render a link preceded by an icon. I'm using Slim templating engine along with Bootstrap CSS. Usually …

ruby-on-rails ruby slim-lang
How can I convert html.slim files to html or html.erb?

I need to convert the html.slim files in my Ruby on Rails application to html.erb. Is there any …

html converter erb slim-lang