简体   繁体   English

为什么我无法访问我的炼油厂CMS路线?

[英]Why can't I access my Refinery CMS route?

I have the following routes in Refinery: 我在炼油厂有以下路线:

$ rake routes | grep blog
                                 blog_root        /blog(.:format)                                                      refinery/blog/posts#index
                                 blog_post GET    /blog/posts/:id(.:format)                                            refinery/blog/posts#show
...

However, when I try to access that route, it gives an error. 但是,当我尝试访问该路由时,会出现错误。

 >   app.refinery.blog_post_path
ActionController::RoutingError: No route matches {:action=>"show", :controller=>"refinery/blog/posts"}

Here is part of routes.rb 这是routes.rb的一部分

  # Refinery
  mount Refinery::Core::Engine, at: '/'

Rails 3.2.14, Refinery 2.1.1. Rails 3.2.14,炼油厂2.1.1。

Two things spring to mind 我想到两件事

  1. You probably don't need to preface refinery.blog_post_path with app although that doesn't seem to be the source of your error. 您可能不需要在app refinery.blog_post_path ,尽管这似乎并不是错误的根源。
  2. More importantly, you have not specified which blog post you want to show. 更重要的是,您尚未指定要显示的博客文章。 So, your code should look something like refinery.blog_post_path my_blog_post.id 因此,您的代码应类似于refinery.blog_post_path my_blog_post.id

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM