SlideShare a Scribd company logo
Submit Search
Upload
Login
Signup
Multi tenant/lang application with Ruby on Rails
Report
Simon Courtois
Follow
CTO Founder at PDFMonkey
Mar. 4, 2014
•
0 likes
•
1,697 views
1
of
14
Multi tenant/lang application with Ruby on Rails
Mar. 4, 2014
•
0 likes
•
1,697 views
Download Now
Download to read offline
Report
Technology
Slides of my "Multi tenant/lang application" at Paris.rb on 2014-03-04.
Simon Courtois
Follow
CTO Founder at PDFMonkey
Recommended
Building WordPress Client Side Applications with WP and WP-API - #wcmia
Roy Sivan
729 views
•
25 slides
App engine beats pony.key
Alper Çugun
628 views
•
31 slides
How to build Client Side Applications with WordPress and WP-API | #wcmia
Roy Sivan
1.9K views
•
25 slides
Drupal8 Front-end Automated Testing
Ruben Teijeiro
1.3K views
•
67 slides
Client Side Applications with WP-API WordPress - WCMTL 2015
Roy Sivan
2.2K views
•
24 slides
Chef for the Symfony developer
Carlos Mafla
319 views
•
50 slides
More Related Content
What's hot
WTF is PWA?
Alan Semenov
43 views
•
33 slides
Introduccion app engine con python
sserrano44
1.9K views
•
25 slides
Angular js full stack development
Darius Riggins
3.4K views
•
9 slides
Padre user experience
Charlie Gonzalez
1.2K views
•
17 slides
Less
Jairo Gatjens
426 views
•
18 slides
symfony & jQuery (phpDay)
Massimiliano Arione
1.2K views
•
25 slides
What's hot
(20)
WTF is PWA?
Alan Semenov
•
43 views
Introduccion app engine con python
sserrano44
•
1.9K views
Angular js full stack development
Darius Riggins
•
3.4K views
Padre user experience
Charlie Gonzalez
•
1.2K views
Less
Jairo Gatjens
•
426 views
symfony & jQuery (phpDay)
Massimiliano Arione
•
1.2K views
Javascript async / await Frontend-IL
Ran Wahle
•
184 views
CPAN Dependency Heaven
OpusVL
•
1.2K views
Deployments... from dreaded to delightful.
Ryan King
•
522 views
Perl ides
Naim Shafiev
•
1.1K views
php tutorial - By Bally Chohan
ballychohanuk
•
1.1K views
Redirect subdomain to webmail
Kaviyarasu Pugaz
•
651 views
Testing Microservices with a Citrus twist
christophd
•
2.9K views
Drupal site translation and translation testing
james_andres
•
2.2K views
Connect front end to back end using SignalR and Messaging
Particular Software
•
2.1K views
JavaScript Testing VIA Selenium
Adam Christian
•
11.1K views
Things I Heart
Glen Barnes
•
448 views
Laravel Forge: Hello World to Hello Production
Joe Ferguson
•
8.1K views
React Component Wars
Eyal Eizenberg
•
103 views
9. lower in Symfony 4
Razvan Raducanu, PhD
•
122 views
Similar to Multi tenant/lang application with Ruby on Rails
Action Controller Overview, Season 2
RORLAB
2.2K views
•
53 slides
php 1
tumetr1
404 views
•
32 slides
Velocity EU 2014 — Offline-first web apps
andrewsmatt
3.9K views
•
54 slides
PhpSpec extension points
Norbert Orzechowicz
2.4K views
•
56 slides
Ruby on Rails at PROMPT ISEL '11
Pedro Cunha
1K views
•
70 slides
Build a bot workshop async primer - php[tek]
Adam Englander
213 views
•
23 slides
Similar to Multi tenant/lang application with Ruby on Rails
(20)
Action Controller Overview, Season 2
RORLAB
•
2.2K views
php 1
tumetr1
•
404 views
Velocity EU 2014 — Offline-first web apps
andrewsmatt
•
3.9K views
PhpSpec extension points
Norbert Orzechowicz
•
2.4K views
Ruby on Rails at PROMPT ISEL '11
Pedro Cunha
•
1K views
Build a bot workshop async primer - php[tek]
Adam Englander
•
213 views
Rails antipatterns
Chul Ju Hong
•
322 views
Rails antipattern-public
Chul Ju Hong
•
1.6K views
Rails Presentation (Anton Dmitriyev)
True-Vision
•
209 views
Primefaces Nextgen Lju
Skills Matter
•
537 views
Primefaces Nextgen Lju
Skills Matter
•
2K views
PHP
sometech
•
5.2K views
Michelle Sanver "Using the Workflow component for e-commerce"
Fwdays
•
451 views
Beyond MVC: from Model to Domain
Jeremy Cook
•
1.5K views
Introduction to php
jgarifuna
•
1.2K views
DSL or NoDSL - Euruko - 29may2010
Plataformatec
•
1.4K views
WebcampZG - Rails 4
shnikola
•
446 views
Real time server
thepian
•
1.1K views
Application Layer in PHP
Per Bernhardt
•
3.4K views
Php My SQL Tutorial | beginning
CRM Manager | Developer @ Websoles Strategic Digital Solutions
•
824 views
More from Simon Courtois
Conseils pour un lancement Product Hunt réussi
Simon Courtois
72 views
•
28 slides
Organize your assets with Rails
Simon Courtois
761 views
•
51 slides
Speed your Rails app creation with templates
Simon Courtois
783 views
•
25 slides
Dependency sorting in Ruby with TSort
Simon Courtois
942 views
•
16 slides
How Unidecoder Transliterates UTF-8 to ASCII
Simon Courtois
781 views
•
34 slides
Get Slim!
Simon Courtois
2.2K views
•
23 slides
More from Simon Courtois
(16)
Conseils pour un lancement Product Hunt réussi
Simon Courtois
•
72 views
Organize your assets with Rails
Simon Courtois
•
761 views
Speed your Rails app creation with templates
Simon Courtois
•
783 views
Dependency sorting in Ruby with TSort
Simon Courtois
•
942 views
How Unidecoder Transliterates UTF-8 to ASCII
Simon Courtois
•
781 views
Get Slim!
Simon Courtois
•
2.2K views
Fake your files - MemFs
Simon Courtois
•
1K views
Rails is like Burger King
Simon Courtois
•
817 views
REST with Her (and let Her take care of the REST)
Simon Courtois
•
3.2K views
Ruby and DCI
Simon Courtois
•
877 views
Cells
Simon Courtois
•
631 views
Mustdown
Simon Courtois
•
954 views
Vos Regexps sont fausses !
Simon Courtois
•
395 views
Ariane
Simon Courtois
•
663 views
Pourquoi Ruby on Rails ça déchire ?
Simon Courtois
•
4.9K views
Commander
Simon Courtois
•
291 views
Recently uploaded
Product Listing Presentation_Cathy.pptx
CatarinaTorrenuevaMa
62 views
•
41 slides
UiPath Tips and Techniques for Error Handling - Session 2
DianaGray10
24 views
•
9 slides
Understanding Wireguard, TLS and Workload Identity
Christian Posta
100 views
•
51 slides
The Ultimate Administrator’s Guide to HCL Nomad Web
panagenda
51 views
•
71 slides
Getting your enterprise ready for Microsoft 365 Copilot
Vignesh Ganesan I Microsoft MVP
89 views
•
38 slides
Accelerating Data Science through Feature Platform, Transformers, and GenAI
FeatureByte
139 views
•
46 slides
Recently uploaded
(20)
Product Listing Presentation_Cathy.pptx
CatarinaTorrenuevaMa
•
62 views
UiPath Tips and Techniques for Error Handling - Session 2
DianaGray10
•
24 views
Understanding Wireguard, TLS and Workload Identity
Christian Posta
•
100 views
The Ultimate Administrator’s Guide to HCL Nomad Web
panagenda
•
51 views
Getting your enterprise ready for Microsoft 365 Copilot
Vignesh Ganesan I Microsoft MVP
•
89 views
Accelerating Data Science through Feature Platform, Transformers, and GenAI
FeatureByte
•
139 views
Keynote: Two years at the British Library... and counting / Alan Danskin (Bri...
CILIP MDG
•
24 views
TEKART CON 2023
AdedoyinSamuel1
•
24 views
Data Formats: Reading and writing JSON – XML - YAML
CSUC - Consorci de Serveis Universitaris de Catalunya
•
54 views
Document Understanding as Cloud APIs and Generative AI Pre-labeling Extractio...
DianaGray10
•
106 views
Swiss Re Reinsurance Solutions - Automated Claims Experience – Insurer Innova...
The Digital Insurer
•
30 views
info_session_gdsc_tmsl .pptx
NikitaSingh741518
•
16 views
BuilderAI Proposal_Malesniak
Michael Lesniak
•
85 views
Future of Skills
Alison B. Lowndes
•
38 views
Swiss Re Reinsurance Solutions - Claims Automated Rules Engine – Insurer Inno...
The Digital Insurer
•
19 views
Cloud Composer workshop at Airflow Summit 2023.pdf
Leah Cole
•
77 views
Advancing Equity and Inclusion for Deaf Students in Higher Education
3Play Media
•
143 views
Easy Salesforce CI/CD with Open Source Only - Dreamforce 23
NicolasVuillamy1
•
186 views
Safe Community Call #12.pdf
LornyPfeifer
•
15 views
ISO Survey 2022: ISO 27001 certificates (ISMS)
Andrey Prozorov, CISM, CIPP/E, CDPSE. LA 27001
•
79 views
Multi tenant/lang application with Ruby on Rails
1.
Multi tenant/lang application Simon Courtois
- @happynoff
2.
Multi-tenant you say?
3.
mywebsite.com otherwebsite.com and-another.com APP
4.
APP middleware switcher Website
5.
Website domain lang class Website <
ActiveRecord::Base def self.current Thread.current[:website] end ! def self.current=(website) Thread.current[:website] = website end end Website.current = Website.first ! Website.current # => #<Website domain=“mywebsite.com" lang="en">
6.
APP middleware switcher ✔ Website Website
7.
switcher class WebsiteSwitcher attr_reader :domain,
:host, :website ! ! ! ! def initialize(host) @host = host.downcase.chomp('.') end def domain @domain ||= ActionDispatch::Http::URL.extract_domain(host) end def website @website ||= Website.where(domain: domain).first || Website.where(domain: 'mywebsite.com') end def switch! Website.current = website I18n.locale = website.lang end end WebsiteSwitcher.new('www.mywebsite.com').switch!
8.
APP middleware ✔ switcher switcher ✔ Website
9.
middleware require 'website_switcher' ! class WebsiteSwitcherMiddleware def
initialize(app) @app = app end ! ! ! def call(env) request = Rack::Request.new(env) WebsiteSwitcher.new(request.host).switch! @app.call(env) end end
10.
APP ✔ middleware middleware ✔ switcher ✔
Website
11.
require 'middlewares/website_switcher_middleware' ! APP module AwesomeApp class
Application < Rails::Application # ... ! config.middleware.use WebsiteSwitcherMiddleware end end
12.
✔ APP APP ✔ middleware ✔
switcher ✔ Website
13.
Questions ?
14.
Thank you Simon Courtois
- @happynoff