I have a Sinatra app which would be used by different clients. I wish to show the client’s Company Logo and a custom layout.erb for each client.
The code base is essentially same for everyone. All I need is a way to easily maintain a different set of files in the ‘Public’ directory and ‘layout.erb’, and when deploying to the remote server, automatically copy only the particular client’s files.
One possible way would be to have a
viewandpublicdirectory per client and set the proper:viewsand:publicoptions for each requestEdit based on comment :
Set your public folder during the
configblock.Now add one subfolder to your public folder for each client. All you have to do to access the specific file is to modify your view to get
/#{params[:client]}/logo.pnginstead of/logo.png