Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

330
Vistas
How to encrypt full routes in ruby on rails at Application level

I want to encrypt routes in ruby on rails application through routes file.

Sample URL: http://localhost:3000/users or http://localhost:3000/users/1/edit

Encrypted URL: http://localhost:3000/dshfkhjkbkbjkdfjkfdhk or http://localhost:3000/dshfkhjkbkbjkdfjkfdhk/dskjfs/hdfkjdf

It's possible to encrypt using any gem. How to manage all routes encryption at the Application level

Thank you in Advance

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can't. All you can do is implement your own router, and map all encrypted paths to a single controller and let that controller call your router.

# config/routes.rb
match '*path', to: 'encrypted#index', via: :all
class EncryptedController < ApplicationController
  def index
    path = params[:path]
    decrypted_path = path.split('/').map{|part| decrypt(part)}.join('/')
    MyRouter.dispatch(request.method, decrypted_path, request)
  end
end
module MyRouter
  def self.dispatch(request_method, path, request)
    # Your own dispatching logic here.
    # Note that this method should return a Rack-compatible response.
  end
end
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda