https://github.com/slim-template/slim-rails
Slim templates generator for Rails
https://github.com/slim-template/slim-rails
Last synced: 8 months ago
JSON representation
Slim templates generator for Rails
- Host: GitHub
- URL: https://github.com/slim-template/slim-rails
- Owner: slim-template
- License: mit
- Created: 2010-10-25T01:15:03.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2024-12-29T17:22:54.000Z (about 1 year ago)
- Last Synced: 2025-04-13T13:55:10.601Z (9 months ago)
- Language: Ruby
- Homepage:
- Size: 154 KB
- Stars: 699
- Watchers: 18
- Forks: 129
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ruby - slim-rails
README
# slim-rails [](http://rubygems.org/gems/slim-rails) [](https://github.com/slim-template/slim-rails/actions/workflows/main.yml) [](https://codeclimate.com/github/slim-template/slim-rails)
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:
```ruby
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`](https://github.com/slim-template/slim/wiki/Template-Converters-ERB-to-SLIM) on how to achieve this.
This gem is [tested with Ruby on Rails 5.2+](/.github/workflows/main.yml).
## History
`slim-rails` was based on [haml-rails](https://github.com/haml/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.