Skip to content

slim-template/slim-rails

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

slim-rails Gem Version Build Status Code Climate

slim-rails provides Slim generators for Rails:

  • Any time you generate a controller or scaffold, you'll get Slim templates (instead of ERB)
  • When your Rails application loads, Slim will be loaded and initialized automatically
  • Slim templates will be respected by the view template cache digestor

To use it, add this line to your Gemfile:

gem "slim-rails"

And that's it.

Every time you generate a controller or scaffold, you'll get Slim templates.

If you have existing .erb templates, check out our guide How to convert your .erb templates to .slim on how to achieve this.

This gem is tested with Ruby on Rails 5.2+.

History

slim-rails was based on haml-rails and it does basically the same thing.

From the version 0.2.0, there is no need to include gem "slim" in your Gemfile.