我正在检查汞编辑器https://github.com/jejacks0n/mercury小项目。范围与汞编辑器+导轨3
这些是我的routes.rb文件
Myapp::Application.routes.draw do
mount Mercury::Engine => '/'
scope '(:locale)' do
resources :post
end
end
我的帖子的网址是:
http://localhost:3000/es/posts/1
http://localhost:3000/en/posts/2
http://localhost:3000/de/posts/3
.
.
.
我的汞路线:
Routes for Mercury::Engine:
mercury_editor /editor(/*requested_uri)(.:format) mercury#edit
/mercury/:type/:resource(.:format) mercury#resource
/mercury/snippets/:name/options(.:format) mercury#snippet_options
/mercury/snippets/:name/preview(.:format) mercury#snippet_preview
我尝试类似:
<%= link_to 'Edit', "/editor" + request.path %>
但我得到一个错误的网址http://localhost:3000/editor/es/posts/2
。
可有人说我如何添加一个指定路径到我的路线是这样的:
http://localhost:3000/es/editor/posts/1
或http://localhost:3000/editor/posts/1
你是什么意思 “我得到一个错误的URL” 是什么意思?这个网址是否有效,但你不喜欢它的外观?或者,网址不工作? 为了什么是值得的,我只是在同一个案例中,你一直在做,并最终做了你做的。而且这个网址'http:// localhost:3000/editor/es/posts/2'都可以正常工作 – 2013-05-18 12:41:06