Is it possible include Nesta CMS into Rails3 application?

前端 未结 2 1054
陌清茗
陌清茗 2021-01-01 05:12

I\'d like \"to mount\" a Nesta CMS app onto a Rails3 app This should be possible couse of being Nesta a Sinatra app, which should be a Rack mountable layer, ... but how woul

2条回答
  •  臣服心动
    2021-01-01 05:35

    Here's the code I used to make it work on my app:

    MyRailsApp::Application.routes.draw do
      mount MyNestaSite.new => "/blog"
      match '/' => "static#welcome" # and whatever other rails routes you want
    end
    

    At the time it also required the latest version of Sinatra from github as the version available via rubygems had a bug in how it handled environment variables, so I added this to my Gemfile:

    gem "sinatra", :git => "http://github.com/sinatra/sinatra.git"
    

提交回复
热议问题