Nesta CMS and Rails3 integration: adding blog to an exiting rails 3 application

纵然是瞬间 提交于 2019-12-01 14:43:43

I've not got this to the level of plug-n-play that I'd like yet, but I'm running Nesta on my Rails 3.0 sites by adding this to config/routes.rb:

mount Nesta::App, :at => '/'
match '/css/*style.css' => Nesta::App
match '/attachments/*file' => Nesta::App

I haven't looked into a cleaner way of doing this yet (i.e. avoiding having to specify css and attachments routes as well).

I created my Nesta app in a directory located at "#{Rails.root}/nesta". I also needed an in config/initializers/nesta.rb:

require "nesta/env"
Nesta::Env.root = ::File.expand_path("../../nesta",
                                     File.dirname(__FILE__))

I quite like the way you've done it too.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!