Does Ruby on Rails support document relative paths? -


as far can tell url helpers in ruby on rails generate site root relative paths.

so if want go http://exemple.com/categories/1 http://exemple.com/questions/12 link /questions/12 (site root relative path).

are there helpers/gems generate document relative path (../questions/12) ?

not sure understand question.

assuming have 2 following routes:

resources :categories resources :questions 

you can jump 1 other using:

category_path(id) question_path(id) 

using suffix path return relative path domain. whereas using url return full url.

category_path(1) #=> /categories/1 category_url(1)  #=> http://exemple.com/categories/1 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -