On Jan 5, 11:10 pm, Valentino Lun <[email protected]>
wrote:
> Dear all
>
> In the MVC architecture framework, the Model is actually communicate
> with database. In my rails project, there is a model/ssh.rb that is not
> connect with database.

That's fine.  The model is the only part of the MVC architecture that
is *allowed* to communicate with the database, but it certainly does
not *have* to do so.  The job of the model is simply to model the
data.  If it needs access to the DB to do that, fine.  If it doesn't
need access to the DB to model the data effectively, also fine.

> Is it a good practice for this arrangement in my
> project?

Probably, although I'm not certain about your particular case.

> Am I violate the rules of MVC architecture?

Not at all.

> Or is it better to
> move all the codes from models to controllers?

Probably not.  The trend in Rails development at the moment seems to
be "skinny controller, fat model".

In other words, you're doing fine.  Don't worry.

Best,
--
Marnen Laibow-Koser
[email protected]
http://www.marnen.org


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to