I know this is an old question but it seems to still get some interests. So I'll post what I came up with.
I am not sure how far you want to be resourceful but this, with globing, works:
resources :articles do
member do
get '*slug', to: 'articles#show', as: 'slugged'
end
end
This also works:
resources :articles do
member do
get ':slug', to: 'articles#show', as: 'slugged'
end
end
In both case, you can then use
<%= link_to slugged_article_path(article, article.title.parameterize) %>
in your views (you might want to define a virtual attribute in your model for the slug, instead of building it dynamically with article.title.parameterize in the view).
Note that so far, Rails will not complain if you enter anything as the slug in your browser.
I personally find the resourceful approach a bit verbose since I am only interested having pretty urls for the show actions (which are the only ones that may be seen by the regular users or the search engine bots) so I find it more simple to simply do:
resources :articles
get 'articles/:id/:slug', to: 'articles#show', as: 'slugged_article'