Using multiple controllers in one view in Rails

前端 未结 3 702
抹茶落季
抹茶落季 2020-12-28 23:29

I\'m working on something like a social networking mesh; I am using different API\'s from various websites, e.g. Last.FM, Delicious, Twitter, ...

I\'ve created one c

3条回答
  •  旧时难觅i
    2020-12-29 00:05

    I think you should read a bit about rails' MVC architecture. It seems to me that you are neglecting the M(odel) part of it. The models should hold the data, thus being the most important part of your application.
    These are a few interesting thoughts on better organizing your models and controllers (fat models, skinny controllers is a rule of thumb.
    Since you said you are using other API's (like lastfm and twitter), you might want to take a look at this railscast about creating non ActiveRecord models (models that are not tied to a database)

    If you also provide an API for your users, I suggest using a RESTful approach, as it can really be easy to develop and maintain once you get the hang of it.
    You should read more about resources, as your localhost/lastfm and localhost/twitter are resources and not views.

    Hope this helps. Good luck

提交回复
热议问题