0

I intend to integrate refinery cms into an existing rails 3.2 application.

I setup a refinery engine as per this guide http://refinerycms.com/guides/with-an-existing-rails-app.

I do not want refinery to generate all the pages in my app. Only a set of new ones.

So in routes.rb I modified the following line:

    mount Refinery::Core::Engine, :at =>'/'

to

    mount Refinery::Core::Engine, :at =>'/cms'

In development mode (I am still testing if I can integrate successfully), when I run the server, if I manually type in

    localhost:3000/cms

the cms system is available.

But if I click on the home link or the links to any other pages created by refinery I get the following error:

    No route matches [GET] "/"

This is because it has been configured by refinery to use the / path.

If I manually type in localhost:3000/cms/(page name), then the pages get rendered.

If the entry in routes.rb is the default entry

    mount Refinery::Core::Engine, :at =>'/'

Then the links to pages created by refinery work fine BUT, the existing pages that were created before I integrated refinery do not render, because refinery is overriding them.

How do I customize the paths for page links created by refinery.

ashsav
  • 121
  • 1
  • 5

1 Answers1

0

Make sure that you are mounting Refinery after your existing routes so that it doen't overrides them since they are prioritized based upon there order of creation.

  • Thanks Usman. Been working on this a month now and the pages still don't use the /cms route. The try to mount on the /. But interestingly, the sub-pages mount on /cms perfectly well – ashsav Mar 22 '13 at 09:54
  • Could you post your routes file and how are you generating the links to the Refinery pages in your views? – Usman Bashir Mar 22 '13 at 14:27
  • I'm not at my workstation right now. But I've followed your advice and mounted it at the end of my routes.rb file. The refinery page links are generated by using the standard refinery functions. No custom way of doing it. The problem is only in the way refinery is generating the links in the admin section.. – ashsav Mar 25 '13 at 05:15