ruby - How write only once path_names on routes and make available for all of routes in Rails 4.1? -


I want to translate my path_names only once, and it is available in all the routes for routes.rb Gets .

This is my routes.rb now:

  PATH_NAMES = {new: 'Novo', edit: 'editar', show: 'Wer'} Rails.application.routes.draw do devise_for: user, controller: {omniauth_callbacks: 'omniauth_callbacks', registration: 'registration'} resource: movements, path: path = & gt; 'Fluxo-d-casa', path_name: PATH_NAMES resource: movement categories ,: path = & gt; '/ Fluxo-de-caixa / categorias', path_name: PATH_NAMES resource: installments, path = & gt; 'Parcel', path_name: PATH_NAMES resource: contract, path = & gt; 'Contratos', path_name: PATH_NAMES resource: accounts, path = & gt; 'Contas', path_name: PATH_NAMES resource: event,: path = & gt; 'Eventos', path_name: PATH_NAMES resource: user,: path = & gt; 'Usuarios', path_name: PATH_NAMES resource: viewer,: path = & gt; 'Aspectors', path_name: PATH_NAMES devise_scope: The user gets '/ cadrestar' & gt; 'Distraction / Registration # New' received '/ record' = & gt; 'Devise / sessions # new' get '/ editar' = & gt; 'Distract / Register # Edit' Delete / Siar = & gt;  

I hope you will help me!

My relationship! ; D

Usage scope :

  Scope (path_name: {new: 'novo', edit: 'editar', show: 'work'}) Resources: movements, path: path = & gt; 'Fluxo-D-Casa' resource: movement categories ,: path = & gt; '/ Fluxo-de-caixa / categorias' resources: installments, path: path = & gt; 'Parcel' resource: contract,: path = & gt; 'Contratos' resource: accounts, path = & gt; 'Contas' Resources: Events, Path = & gt; 'Eventos' resource: User ,: path = & gt; 'Usuarios' resource: viewer ,: path = & gt; 'Espectadores' end  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -