Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
Taking functionality out of the controller and model
3 Posts
Taking functionality out of the controller and model

Well, I think choosing Rails to begin with must be something not done out of the whim. If you pick Rails, then you must love what convention it has already native to the framework. If some people must opt to strip it down further or abstract some logic further away from controllers and models, I honestly think they are doing it wrong.

Maybe start creating their own stripped down version with only their classes involved would be a way to go. Otherwise, maybe they started out wrong by picking Rails for their project requirements. IMHO.

Maricrisnonato121213
well seasoned senior ruby on rails de...
Forum Rating: 100
Sign In To Rate Post

It's all a balancing act. Fat models are harder to test... but having too many models is a mess. So long as a model fits well with general OO/SE principles, like having only one job, it doesn't need to be broken up -- but with a typical Rails app, most of your models immediately have two concerns, their business-logic function and persistence.

Person
Forum Rating: 100
Sign In To Rate Post

Interesting discussion on Twitter about abstracting away from your controllers and your models but putting functionality in a class of its own. DHH says no. Anybody have any thoughts? What's your preference and why?

Screen_shot_2012-10-12_at_22.27.48
WWR
Administrator
Forum Rating: 50
Sign In To Rate Post
3 Posts
Login to add your message