Rafael Lima
2006-Feb-06 22:36 UTC
[Rails] Two subdomains with diferent controllers but same helpers and components
Hi, I want to have www.myproduct.com and myclient1.myproduct.com working on same server. I would like to have different controller in wich subdomains, example: on www I want to have sgnup and prices controller and on myclient subdomain I want login, settings, etc... I can open two environments rails www rails clients or point the two subdomains to same environment rails myproduct Wich is the best choice. Is there any way to share the helpers and components between the www and the clients environments? If I choose the second way, is there a way to define controllers by subdomain? Thanks for all -- Atenciosamente, Rafael Lima rafael.lima@email.com.br ===========================================================Esta mensagem pode conter informa??es confidenciais, caso voc? n?o seja o real destinat?rio, apague-a de sua caixa postal. A reprodu??o ou utiliza??o do material contido nesta mensagem n?o ? permitida sem pr?via autoriza??o do autor. Agrade?o a compreens?o. ============================================================
James
2006-Feb-07 21:49 UTC
[Rails] Two subdomains with diferent controllers but same helpers and components
Rafael Lima wrote:>Hi, > >I want to have www.myproduct.com and myclient1.myproduct.com working on same >server. > >I would like to have different controller in wich subdomains, example: >on www I want to have sgnup and prices controller and on myclient subdomain I >want login, settings, etc... > >I can open two environments >rails www >rails clients > >or point the two subdomains to same environment >rails myproduct > >Wich is the best choice. Is there any way to share the helpers and components >between the www and the clients environments? > >If I choose the second way, is there a way to define controllers by subdomain? > >Thanks for all > > >I''ve had to work on this in a similar environment, I had one https url and one regular http url. What I did is for those controllers that /must/ be on the secure site I have a before_filter that checks the domain, and if it''s not right it re-directs them. Only in production though, in dev it just writes a note to the log that you should be re-directed. --James