Project

slim-rails

1.52
Low commit activity in last 3 years
A long-lived project that still receives updates
Provides the generator settings required for Rails to use Slim
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

Runtime

>= 3.1
>= 3.0, < 5.0
 Project Readme

slim-rails Gem Version Build Status Code Climate

slim-rails provides Slim generators for Rails 3+. It was based on haml-rails and it does basically the same:

  • 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.

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

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

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