Question

I instructed config/routes.rb to use Refinery Blog as a root directory:

root :to => "refinery/blog/posts#index"
mount Refinery::Core::Engine, :at => '/'

In a app/view/layouts/_header.html.slim I'm trying to use blog_root route. For example:

= link_to (image_tag "/logo.gif"), blog_root, class: "brand"

The route is listed when I issue rake routes:

blog_root        /blog(.:format)      refinery/blog/posts#index

But nothing shows up, the system gives an error:

undefined local variable or method `blog_root' for 
#<#<Class:0x00000005e62f80>:0x007fd7241d94c8>

Also, I tryed blog_root_path, but it didn't work either.

Anything I can do in this situation? Thanks a lot!

Was it helpful?

Solution

This question/answer pair was helpful.

I looked inside config/routes.rb of main app, and in comments it was writted that 'We ask that you don't use the :as option here, as Refinery relies on it being the default of "refinery"'.

So, the working route is refinery.blog_root_path.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top