Answer by V K Singh for How do I get the current absolute URL in Ruby on Rails?
For Rails 3.x and up:#{request.protocol}#{request.host_with_port}#{request.fullpath}For Rails 3.2 and up:request.original_urlBecause in rails 3.2 and up:request.original_url = request.base_url +...
View ArticleAnswer by Amit for How do I get the current absolute URL in Ruby on Rails?
For Rails 3.2 or Rails 4Simply get in this way "request.original_url"Reference: Original URL MethodFor Rails 3As request.url is deprecated.We can get absolute path by...
View ArticleAnswer by RaK427 for How do I get the current absolute URL in Ruby on Rails?
You can set a variable to URI.parse(current_url), I don't see this proposal here yet and it works for me.
View ArticleAnswer by Robin Garg for How do I get the current absolute URL in Ruby on Rails?
You can either use request.original_url or "#{request.protocol}#{request.host_with_port}"to get the current URL.
View ArticleAnswer by Ali Hassan Mirza for How do I get the current absolute URL in Ruby...
You can use:request.full_pathor request.urlHopefully it will resolve your problem.Cheers
View ArticleAnswer by user3118220 for How do I get the current absolute URL in Ruby on...
Rails 4Controller:def absolute_url request.base_url + request.original_fullpathendAction Mailer Notable changes in 4.2 release:link_to and url_for generate absolute URLs by default in templates, it is...
View ArticleAnswer by Nerve for How do I get the current absolute URL in Ruby on Rails?
To get the request URL without any query parameters.def current_url_without_parameters request.base_url + request.pathend
View ArticleAnswer by Arvind singh for How do I get the current absolute URL in Ruby on...
Rails 4.0you can use request.original_url, output will be as given below exampleget "/articles?page=2"request.original_url # => "http://www.example.com/articles?page=2"
View ArticleAnswer by user3355933 for How do I get the current absolute URL in Ruby on...
you can get absolute url by calling:request.original_urlor request.env['HTTP_REFERER']
View ArticleAnswer by uma for How do I get the current absolute URL in Ruby on Rails?
you can use any one for rails 3.2:request.original_urlorrequest.env["HTTP_REFERER"]orrequest.env['REQUEST_URI']I think it will work every...
View ArticleAnswer by Satishakumar Awati for How do I get the current absolute URL in...
request.env["REQUEST_URI"]works in rails 2.3.4 tested and do not know about other versions.
View ArticleAnswer by Pankhuri for How do I get the current absolute URL in Ruby on Rails?
For rails 3 :request.fullpath
View ArticleAnswer by Idan Wender for How do I get the current absolute URL in Ruby on...
You can use the ruby method::root_urlwhich will get the full path with base url:localhost:3000/bla
View ArticleAnswer by Mike for How do I get the current absolute URL in Ruby on Rails?
If you're using Rails 3.2 or Rails 4, you should use request.original_url to get the current URL.Documentation for the method is at...
View ArticleAnswer by mikrobi for How do I get the current absolute URL in Ruby on Rails?
In Rails 3 you can userequest.original_urlhttp://apidock.com/rails/v3.2.8/ActionDispatch/Request/original_url
View ArticleAnswer by Victor S for How do I get the current absolute URL in Ruby on Rails?
if you want to be specific, meaning, you know the path you need: link_to current_path(@resource, :only_path => false), current_path(@resource)
View ArticleAnswer by Ahmad hamza for How do I get the current absolute URL in Ruby on...
To get the absolute URL which means that the from the root it can be displayed like this <%= link_to 'Edit', edit_user_url(user) %>The users_url helper generates a URL that includes the protocol...
View ArticleAnswer by Sergiy Seletskyy for How do I get the current absolute URL in Ruby...
Using Ruby 1.9.3-p194 and Ruby on Rails 3.2.6:If request.fullpath doesn't work for you, try request.env["HTTP_REFERER"]Here's my story below.I got similar problem with detecting current URL (which is...
View ArticleAnswer by Frans for How do I get the current absolute URL in Ruby on Rails?
None of the suggestions here in the thread helped me sadly, except the one where someone said he used the debugger to find what he looked for.I've created some custom error pages instead of the...
View ArticleAnswer by msroot for How do I get the current absolute URL in Ruby on Rails?
(url_for(:only_path => false) == "/" )? root_url : url_for(:only_path => false)
View ArticleAnswer by Tim Santeford for How do I get the current absolute URL in Ruby on...
This works for Ruby on Rails 3.0 and should be supported by most versions of Ruby on Rails:request.env['REQUEST_URI']
View ArticleAnswer by Yuri Barbashov for How do I get the current absolute URL in Ruby on...
url_for(params)And you can easily add some new parameter:url_for(params.merge(:tag => "lol"))
View ArticleAnswer by Dorian for How do I get the current absolute URL in Ruby on Rails?
I needed the application URL but with the subdirectory. I used:root_url(:only_path => false)
View ArticleAnswer by grzuy for How do I get the current absolute URL in Ruby on Rails?
You could use url_for(only_path: false)
View ArticleAnswer by Duke for How do I get the current absolute URL in Ruby on Rails?
For Ruby on Rails 3:request.urlrequest.host_with_portI fired up a debugger session and queried the request object:request.public_methods
View ArticleAnswer by Lucas Renan for How do I get the current absolute URL in Ruby on...
In Ruby on Rails 3.1.0.rc4: request.fullpath
View ArticleAnswer by Ken Earley for How do I get the current absolute URL in Ruby on Rails?
It looks like request_uri is deprecated in Ruby on Rails 3.Using #request_uri is deprecated. Use fullpath instead.
View ArticleAnswer by mcr for How do I get the current absolute URL in Ruby on Rails?
I think that the Ruby on Rails 3.0 method is now request.fullpath.
View ArticleAnswer by ecoologic for How do I get the current absolute URL in Ruby on Rails?
DEPRECATION WARNING: Using #request_uri is deprecated. Use fullpath instead.
View ArticleAnswer by grosser for How do I get the current absolute URL in Ruby on Rails?
You can add this current_url method in the ApplicationController to return the current URL and allow merging in other parameters# https://x.com/y/1?page=1 # + current_url( :page => 3 )# =...
View ArticleAnswer by James M for How do I get the current absolute URL in Ruby on Rails?
I think request.domain would work, but what if you're in a sub directory like blah.blah.com? Something like this could work:<%= request.env["HTTP_HOST"] + page = "/"+...
View ArticleAnswer by Jaime Bellmyer for How do I get the current absolute URL in Ruby on...
For Rails 3.2 or Rails 4+You should use request.original_url to get the current URL. Source code on current repo found here.This method is documented at original_url method, but if you're curious, the...
View ArticleAnswer by ghoppe for How do I get the current absolute URL in Ruby on Rails?
If by relative, you mean just without the domain, then look into request.domain.
View ArticleHow do I get the current absolute URL in Ruby on Rails?
How can I get the current absolute URL in my Ruby on Rails view?The request.request_uri only returns the relative URL.
View Article
More Pages to Explore .....