I am using rails on an Apache server. I can't install my rails app on the public root directory. So I have it on /web
. With an .htaccess I rewrite any URL from /
to /web
. For example /something
will be /web/something
and so on.
Now, in my app, I build my links with the url helper link_to
:
link_to "Timeline", timeline_path
But it yields /web/en/timeline
instead of /en/timeline
. The en is just the locale to work with i18n.
Is there a way to force link_to
to create just the /en/timeline path or do I have to write it manually? Like so:
link_to "Timeline", "/en/timeline"
Edit: To add info as JoseE ask.
This is my routes.rb file:
get "home/index"
root:to => 'home#index'
match '/:locale' => 'home#index'
scope "/:locale" do
match 'timeline' => 'timeline_articles#index'
match 'home' => 'home#index'
end