css - Stylesheet depends on hostname -
Sorry my english I'm working on multi-face site I'll change the CSS stylesheet based on the URL given to me, which runs on the Sintra. Like: then in index.erb view: But if the action file contains a space code, then the content of all pages is "Style 1" or "Style 2". To prevent this, I have to keep the case code in every get the action. I think this is not a Ruby way. Is there any possible way to move "stylish rewriting" into any work, or in this case there are other ways of implementing CSS restructuring? Thank you in advance. This is a very good reason to use a helpful method. First Add Auxiliary: Then in your index.erb: Disclaimer: I do not use ERB, so do not work outside the box. Besides, I do not know if index.erb is a template for all your pages, so you have to put that line in each .arch file that you do.
get '/ *' do request.host when 'site1.com' @ style = 'style1' when 'site2.com' @ style = 'style2' end erb : Index end
Include helpers in def CSS Host (host) case when host 'Site 1 dot' 'style 1' when 'site2 dot' 'style 2' and end and end / Pre>
& lt; Link rel = "stylesheet" src = "../// lt;% = include_css (request.host)%> .css" & gt;
Comments
Post a Comment