Ⅰ. 插件描述
Slim templates generator for Rails 3, 4 and 5Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'slim-template/slim-rails'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'slim-template/slim-rails'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'slim-template/slim-rails'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/slim-template/slim-rails
Ⅳ. 文档说明
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.