Reputation: 45
I'm in the process of learning Ruby on Rails, and I'm coming from just learning the Django framework. One thing that I liked about Django was the Sites Framework. Is there any equivalent of this in Rails?
Basically, I'm looking to have a single Rails app be run for multiple sites - and I want to filter models automagically based on the hostname. I'm currently working with Rails 3.0.5. Any thoughts/links/examples would be greatly appreciated!
Upvotes: 4
Views: 423
Reputation: 2020
I actually spent a lot of time researching this recently. The quick answer is no, there isn't a clear equivalent. You can approach that kind of behavior from two sides, depending on how independent you want your sites to be. On the more independent side, you can have multiple apps that share behavior by using Rails Engines, where you basically package your parent app as a gem. On the less independent side, there are various things you can do to customize a single app's behavior based on domain/subdomain.
Which of these is closer to what you want? What kinds of things are you looking to customize?
Upvotes: 2