我正在检查小项目的水银编辑器https://github.com/jejacks0n/mercury。
这些是我的 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