S
S
snater2012-07-21 16:15:54
Ruby on Rails
snater, 2012-07-21 16:15:54

How to port wordpress-like CNC to Rails?

The task was to transfer the WP-blog to rails, but in such a way as to preserve the appearance of links to articles. Are there any standard tools or gems to fine-tune CNC in rails? Now the links look like this - "/2012/07/21/some-article-title".
So far, I haven't come up with anything better than just " match '/:slug' => 'articles#show'".

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SmartBye, 2012-07-21
@snater

Maybe something like this:
match "/:date/:title" => "articles#show",
:constraints => { :date => /\d{4}/\d{2}/\d{2 }/ },
:as => "acticle"

T
Tenkoff, 2012-07-22
@Tenkoff

Take a look at railscasts.com/episodes/314-pretty-urls-with-friendlyid

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question