Reputation: 4554
Lets assume my RoR app lives at
In a view file, how can I get that path?
Upvotes: 0
Views: 1292
Reputation: 6662
To get full url of the current page you can use
current_url = request.request_uri
This will return you full url, you can then gsub http or https. Hope this was you were looking for.
Thanks..
Upvotes: 5
Reputation: 6662
For rails 3+ Use :
@app_root_path = Rails.root
For rails < 3 Use
@app_root_path = RAILS_ROOT
Upvotes: 3
Reputation: 6068
You can get the path by following:-
@rails_app_path = RAILS_ROOT
Thanks......
Upvotes: 1