Skip to content

Instantly share code, notes, and snippets.

@rahul100885
rahul100885 / routes.rb
Created May 6, 2014 05:01
How to: override devise default routes of sign in and sign out
MyApp::Application.routes.draw do
# If you concern about SEO then send permanent redirect (301) on old routes to new routes
# It is always better to do this setting in web server that is in nginx or apache.
# Here I am showing how to do it in rails routes file
get '/users/sign_in', to: redirect("/sign-in")
get '/users/sign_up', to: redirect("/sign-up")
# Need to skip session and registration so that we can override them in devise_scope block
# If we not do so then default route of devise continue to work
devise_for :users, :skip => [:sessions, :registrations]
@pcreux
pcreux / Gemfile
Last active November 6, 2025 11:25
Fast Rails + Heroku Configuration
group :production do
gem 'unicorn'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
end