ruby-on-railsrefinerycmsrefinery

how to add custom routes to refinerycms


i need to add a custom path to refinerycms project, here is how i did it:

mount Refinery::Core::Engine, :at => '/'
get 'news/more' => 'refinery::news::items#view_more', as: :news_view_more

now 'rake routes' can prints correct routes, but i can't refer to that path by refinery.news_view_more_path, however i found some code like ’refinery.news_item_path‘ in refinerycms gem source code, i want my custom routes can be refered that way.

thanks !


Solution

  • @manosagent, i can add routes like that:

    Refinery::Core::Engine.routes.prepend do
      get 'news/more' => 'news::items#view_more', as: :news_view_more
      get 'notices/more' => 'notices::notices#view_more', as: :notices_view_more
    end
    

    but i don't understand why new/more appears twice in rake routes, i need to dig deeper ...