tencet tencet - 14 days ago 7
Ruby Question

Change url of controller

I have the controller tencet and the method index.

Url:

localhost:3000/tencet/index


I want change url of this page to

localhost:3000/admin


How can I do it?

Answer

Assuming site is your domain and not a namespace...

In your config/routes.rb file:

get '/admin', to: 'tencet#index'