开发者

How to get trailing slash from root_path?

开发者 https://www.devze.com 2023-03-07 20:34 出处:网络
I\'ve got the whole app running in under www.example.com/myapp/. I\'ve got the typical root setup in my app using scope as in:

I've got the whole app running in under www.example.com/myapp/.

I've got the typical root setup in my app using scope as in:

scope "/myapp/" do
  root :to => "home#index"
end

I'd like to use the root_path method. However, it omits the final trailing slash and this interferes with routing in my web s开发者_运维百科erver. I could certainly fuss with the web server routing, but I'd really just like rails to give me a trailing slash.


root_path is deprecated: http://apidock.com/rails/Rails/Configuration/root_path . I'm pretty sure you want something like the examples provided here http://joneslee85.wordpress.com/2010/05/27/the-dilemma-of-rails-root-vs-rails_root-complex/, look at Rails.root.

0

精彩评论

暂无评论...
验证码 换一张
取 消