I am new to Ruby on Rails and my questions are about the application design, based on Rails 3. There are many data on the internet on the creation of standard websites (such as blogs) on Rails, but my application requires more than just "post and read" and I am not sure how to implement that.
The idea:
- The model "Route" includes a number of airlines modules: "Ryanair", "easyJet", etc.
- The "Route.Update" method calls the "UpdateRoutes" on each airline module (for example, "Ryanair.UpdateRoutes", "easyJet.UpdateRoutes")
- It should work the same way with more models (such as "Flight.find") and more airlines ("Delta.FindFlights")
The questions:
- Where should I store all the modules? I don't see any app/modules folder in Rails.
- If my modules require gems, should I include them in the modules or in the models (where they are actually used)?
- I want to make my application scalable. For example, I want to add a new working airline (module) without changing any code in "Route", "Flight" or any other model. I imagine something like the method "IncludeAirlines" which would go through modules/airlines/name.rb, include every module and call the needed method of it (such as name.UpdateRoutes). Is there any better way to implement that in Ruby on Rails?