Want more GoRails?

GoRails is packed full with 719 lessons just like this one.

Sign up to get full access or log in to your account and sit back.

Handling Subdomains and Multitenancy From Scratch

March 26, 2015

Track your progress

Sign in to track your progress and access subscription-only lessons.

Log In

Your Teacher

Hi, I'm Chris. I'm the creator of GoRails, Hatchbox.io and Jumpstart. I spend my time creating tutorials and tools to help Ruby on Rails developers build apps better and faster.

About This Episode

Learn how to handle subdomains in your Rails application for multi-tenant applications

Notes

Resources

Notes

Add nested attributes to devise strong params by adding these lines into your ApplicationController:

class ApplicationController < ActionController::Base

  before_action :configure_permitted_parameters, if: :devise_controller?

  def configure_permitted_parameters
    devise_parameter_sanitizer.for(:sign_up) { |u|
      u.permit(:email, :password, :password_confirmation, account_attributes: [:subdomain])
    }
  end
end

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.