我只想将我的 path_names 翻译一次,并让他可用于routes.rb
.
这是我的routes.rb
现在:
PATH_NAMES = { new: 'novo', edit: 'editar', show: 'ver' }
Rails.application.routes.draw do
devise_for :users, controllers: { omniauth_callbacks: 'omniauth_callbacks',
registrations: 'registrations' }
resources :movements, :path => 'fluxo-de-caixa', path_names: PATH_NAMES
resources :movement_categories, :path => '/fluxo-de-caixa/categorias', path_names: PATH_NAMES
resources :installments, :path => 'parcelas', path_names: PATH_NAMES
resources :contracts, :path => 'contratos', path_names: PATH_NAMES
resources :accounts, :path => 'contas', path_names: PATH_NAMES
resources :events, :path => 'eventos', path_names: PATH_NAMES
resources :users, :path => 'usuarios', path_names: PATH_NAMES
resources :spectator, :path => 'espectadores', path_names: PATH_NAMES
devise_scope :user do
get '/cadastrar' => 'devise/registrations#new'
get '/entrar' => 'devise/sessions#new'
get '/editar' => 'devise/registrations#edit'
delete '/sair' => 'devise/sessions#destroy'
end
root 'home#index'
end
我希望你能帮助我!!
致以我的问候!;D