Question

I am trying to mask a url of a show action in a controller with an id to just "sample" but it won't mask:

get '/sample' => redirect("/posts/2"), :as => '/sample'

What's wrong with the above?

Était-ce utile?

La solution

Try : get "/sample" => "posts#show", id: 2

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top