Thursday, 15 May 2014

How to mount refinerycms engine on a custom path in existing rails application -



How to mount refinerycms engine on a custom path in existing rails application -

i intend integrate refinery cms existing rails 3.2 application.

i setup refinery engine per guide http://refinerycms.com/guides/with-an-existing-rails-app.

i not want refinery generate pages in app. set of new ones.

so in routes.rb modified next line:

mount refinery::core::engine, :at =>'/'

to

mount refinery::core::engine, :at =>'/cms'

in development mode (i still testing if can integrate successfully), when run server, if manually type in

localhost:3000/cms

the cms scheme available.

but if click on home link or links other pages created refinery next error:

no route matches [get] "/"

this because has been configured refinery utilize / path.

if manually type in localhost:3000/cms/(page name), pages rendered.

if entry in routes.rb default entry

mount refinery::core::engine, :at =>'/'

then links pages created refinery work fine but, existing pages created before integrated refinery not render, because refinery overriding them.

how customize paths page links created refinery.

make sure mounting refinery after existing routes doen't overrides them since prioritized based upon there order of creation.

ruby-on-rails-3.2 refinerycms

No comments:

Post a Comment