简单的说一下过程。
首先,rails myapp就不多说了,
sudo gem install lipsiadmin (这一步可以先不急,后面说为什么)
然后编辑 config/environment.rb 这个文件,加入
config.gem "lipsiadmin", :version => "< 5.0"
这时候用
rake gems:install
来安装,版本小于5.0 的lipsiadmin的gem,为什么呢,官方原话:
Why we need to specify version? Simply because we mantain backward compatibility until a 5.0 version. This mean that before v 5.0 we only do small improvemets, bug fix, doc etc... OK,也就是说,前面的稳定些,大家都用5.0之前的,这就是我前面说的不急着装的原因,
因为直接装的都是5.0以上版本,还要重装。然后,就是
ruby script/generate
就可以看到有哪些可以自动生成的代码,
Installed Generators Builtin: controller, integration_test, mailer, migration, model, etc.. Lipsiadmin: attachment, backend, backend_page, pdf, loops$ script/generate backend # Generate the base admin$ script/generate backend_page yourmodel # Generate a "scaffold" for your model$ script/generate state_session # Create a "scaffold" for store extjs grid settings in db$ script/generate loops # Generate background workers$ script/generate frontend # Generate the base frontend$ script/generate attachment # Generate the an attachments$ script/generate pdf PdfName # Generate a new pdf document