I would like to create routes on RoR for a media website with different sections of articles (ecology
, legal
, economy
, etc...)
I would like my url goes like this
root/magazine/ecology/name-of-articles
(nothing corresponding on rails routing/rails guide, nested and collection routes don't fit for me I think)
here is my try:
get 'magazine/ecology/name-of-article', to: 'articles#name_of_article'
views: folders articles => magazine => ecology => file: name_of_article
controller: articles
But it's not working ...answer from rails below Thx for your help
ActionController::UnknownFormat at /magazine/actualite-juridique/legislation-ce-qui-change-en-2017 ArticlesController#legislation_2017 is missing a template for this request format and variant.
request.formats: ["text/html"] request.variant: []
NOTE! For XHR/Ajax or API requests, this action would normally respond with 204 No Content: an empty white screen. Since you're loading it in a web browser, we assume that you expected to actually render a template, not nothing, so we're showing an error to be extra-clear. If you expect 204 No Content, carry on. That's what you'll get from an XHR or API request. Give it a shot.