Answer the question
In order to leave comments, you need to log in
How to make URL with date separated by slashes?
I'm using the Friendly_id gem in a Rails 4 application to make URLs friendlier. At the moment, I can generate an address like /article/23/my-article-title
, where 23 is the id of the article. Today on many blogs you can see the date or id in the URLs.. How can I generate a date based URL by type?/articles/2014/01/22/my-article-title
Answer the question
In order to leave comments, you need to log in
config/routes.rb
= link_to 'Моя статья', date_url_path(:day=> day, :month => month, :year => year, :title => title)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question