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
0
votes
1 answer

ECT with slim/jade like syntax

I am looking for a coffeescript client side templating engine with slim like syntax..ECT currently supports coffeescript template but with html syntax
coool
  • 8,085
  • 12
  • 60
  • 80
0
votes
2 answers

How do I delete a comment associated with a post?

I'm currently following along the basic Rails guide for creating a blog and I'm having trouble with deleting my comments associated with the post. Here is my comments controller: class CommentsController < ApplicationController def create @post =…
Ryan Waits
  • 197
  • 1
  • 5
  • 18
0
votes
1 answer

Passing value from a dropdown box in Sqlite3 table with Sequel

I am trying to create a form where the user gives the title of an album and picks the artist name from a dropdown box. The problem is that I don't know how to take the value from the dropdown box.The new album is saved without any artist_id. I am…
magmike
  • 473
  • 1
  • 5
  • 18
0
votes
1 answer

Rails slims template output in javascript

As we know,we can output in slim like this: div h1 =session[:mem] But now,I have to output an var in javascript which embedded in slim. For example: javascript: var a=(=session[:mem]); Obviously,this will raise an error. So I wan to know how…
HXH
  • 1,643
  • 4
  • 19
  • 31
0
votes
1 answer

Dynamic queries with DataMapper

I would like to be able to make dynamic queries with DataMapper ,for searching an Sqlite database for my Sinatra project.Is it possible? So far I have come up with something like this trying to get the songs that are sang from the artist specified…
magmike
  • 473
  • 1
  • 5
  • 18
0
votes
1 answer

404 Error in Sinatra App using DataMapper

I am trying to extend an example I saw in a sinatra book.I wanted to experiment with DataMapper so I ended up with this: require 'dm-core' require 'dm-migrations' require 'rubygems' require 'sinatra' configure:development do …
magmike
  • 473
  • 1
  • 5
  • 18
0
votes
1 answer

how to convert this slim to ERB?

Am trying autocomplete in rails. since am noob in rails am not able to convert this slim code to erb so can anybody help me out!!! first slim file # app/views/books/index.html.slim = form_tag books_path, class: "form-inline", method: :get…
shamseer
  • 13
  • 1
  • 2
0
votes
1 answer

Can templates coexist and still one of them be used in Rails?

I am semi-forking Redmine for my company and rarely pulling improvements from upstream. I prefer to use SLIM over ERB for views. My idea is that I want to keep erb files intact for the sake of easier diff-ing when I pull changes from upstream, still…
Ikon
  • 661
  • 8
  • 14
0
votes
1 answer

Adding Bootstrap Glyphicon in Slim/Ruby on Rails form as a placeholder

As of right now, the code for the relevant section: = form_for(resource, as: resource_name, url: registration_path(resource_name), html:{id:'registration-form'}) do |f| = devise_error_messages! div style="padding:4px" =…
Free
  • 663
  • 9
  • 13
0
votes
2 answers

Rails 4, Unknown action, The action 'destroy' could not be found for PostsController

What is usually a simple error with a simple solution, I seem to be stuck: posts#controller: class PostsController < ApplicationController def index @posts = Post.all end def show @post = Post.find params[:id] end def new @post =…
Ryan Waits
  • 197
  • 1
  • 5
  • 18
0
votes
2 answers

Rails 4, Argument Error Unknown Key, Update Controller

I receive an error when trying to edit a post: posts#edit controller: def edit @post = Post.find params[:id] end posts#update controller: def update @post = Post.find params[:post] if @post.update_attributes params[:post] redirect_to…
Ryan Waits
  • 197
  • 1
  • 5
  • 18
0
votes
2 answers

Setting CSS for Launchpage that is different from Rails Application

I have two different sets of CSS files that I want to use for the same website hosted with heroku. The first set of CSS files are the standard Twitter BootStrap CSS files converted to SASS. The second set are custom settings for my application. I…
0
votes
1 answer

Why a syntax error rises for the form_for with nested resources?

I have a form_for form helper: = form_for([@search, @search_request], url: {action: @search_form[:search_action]}, method: @search_form[:http_method], remote: true, html: {id: @search_form[:html_id]}, data: {type: "json"}) do…
static
  • 8,126
  • 15
  • 63
  • 89
0
votes
3 answers

How to make Rails render slim templates instead of erb templates?

In my current project I used to use erb as the default view template, then I decided to switch to slim, so I used tools to convert all the .erb files to .slim files. Now I have erb and slim files co-exist in the same folder, the problem is after I…
ugoa
  • 117
  • 9
0
votes
2 answers

How to use SLIM by default template language instead ERB in Ruby on Rails

I need to use Slim-rails in all my Rails projects. How to use Slim-rails by default?
Calirails
  • 367
  • 1
  • 3
  • 10