B
B
Bogdan2017-04-27 17:14:23
Ruby on Rails
Bogdan, 2017-04-27 17:14:23

Changing controller path in Rails routes?

Hello how to change the path in routes ("config\route.rb") rails

namespace :institution do
    get :index, path: '', to: "application#index" # Главная страничка
  end

Gives result
Helper HTTP Verb Path Controller#Action
institution_index_path GET /institution(.:format) institution/application#index
The path to the controller should be just "application#index", not "institution/application#index". Can this be done inside a namespace?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitri Sinitsa, 2017-04-28
@unabl4

Either change the namespace to scope, or put a slash before the controller name, then the path will become absolute, not relative.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question