0

I have a controller named "materiels" I wanted a custom url for all content from this controller, so I have write this in routes. rb

resources :materiels, path: 'materiel-de-mangaka'

Until now, all is fine. I create content and all the content have this custom url Now I want to create a custom page papier.html.erb and reuse the url in order to like /materiel-de-mangaka/papier

So I add this line in routes.rb

get '/materiel-de-mangaka/papier' => 'materiels#papier'

So it doesn't working... How I can route papier.html.erb page by reusing the same url path to become materiel-de-mangaka/papier without create a new content ? Thank you for your time.

1 Answers1

0

If it is under a controller: "/controller name/action name"

resources :materiels do member do get 'papier' end end

If it is only "/action name"

get "papier"  => "materiels#papier"
  • Thank you. No, I want to use the "materiel-de-mangaka" for the "materiels" resources, but I want use this url to, for "materiel-de-mangaka/papier" html.erb page. – Jean-Baptiste Jan 03 '17 at 14:22