Aleksey Gureiev wrote:
> I'm sorry, looked at the wrong page and didn't notice the ongoing
> discussion.
>
> As you could see, I second that you don't need fat controllers and
> that CSV processing logic belongs to a CSVProcessor model (not
> module). It doesn't have a table, but it is a standalon
I'm sorry, looked at the wrong page and didn't notice the ongoing
discussion.
As you could see, I second that you don't need fat controllers and
that CSV processing logic belongs to a CSVProcessor model (not
module). It doesn't have a table, but it is a standalone entity that
knows how to work wit
Hi Martin,
That's a pretty common situation that you describe. One way, which is
adopted by Rails team is to factor your related methods in modules and
include them in your controllers. You can put those modules near your
controllers or under /lib (which is loaded automatically).
But before doing
Martin Berli wrote:
[...]
>
> Are you suggesting to put "everything" into a model, even if it's not
> related to a database object? So to also put classes into the the
> app/models directory, which are not of type ActiveRecord::Base ?
Often, yes. Models are not only for database objects. Read
Sharagoz -- wrote:
> Code that doesn't fit neatly into a model, view or controller, or that
> is shared across multiple models, views or controllers, should be
> extracted into a module most of the time, and included where it needs to
> be.
Thanks, that's really what I needed. To put all the c
Code that doesn't fit neatly into a model, view or controller, or that
is shared across multiple models, views or controllers, should be
extracted into a module most of the time, and included where it needs to
be. So if you have some controller code like the CSV processing that you
mentioned, i
Sharagoz -- wrote:
> If your controllers are getting fat it might be an indication that you
> are putting a lot of the logic in the wrong place and not using the MVC
> architecture the way its ment to be used. "Skinny controller, fat model"
> is the practice most try to follow. The "calculation
If your controllers are getting fat it might be an indication that you
are putting a lot of the logic in the wrong place and not using the MVC
architecture the way its ment to be used. "Skinny controller, fat model"
is the practice most try to follow. The "calculation detail" usually
belongs in
8 matches
Mail list logo