Diffrence between path and url routes helper rails


Difference between path and url routes helper rails


about_path -> '/about'
about_url  -> 'http://localhost:3000/about'

Note that about_url is the full URL http://localhost:3000/about (with localhost:3000 being replaced with the domain name, such as example.com, for a fully deployed site).

To get just /about, you use about_path. In the Rails Tutorial, we’ll follow the common convention of using the path form except when doing redirects, where we’ll use the url form. This is because after redirects the HTTP standard technically requires a full URL, although in most browsers it will work either way.

Advertisements

I am Senior Software Engineer. I love reading, writing, sharing,developing, hiking, movies, trips, mountains, brooks, hills etc.

Tagged with:
Posted in html.erb, Ruby Little Codes
One comment on “Diffrence between path and url routes helper rails

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

StackOverFlow
Categories
Archives
%d bloggers like this: