Ruby on Rails Saturday, September 2, 2017

On Fri, Sep 1, 2017 at 6:50 PM, Ben Edwards <login@funkytwig.com> wrote:

> So do I put the venue and event methods in to controllers or is there
> somewhere else. The venue and event classes map to tables which is why this
> seems the way to go. I want to put them into rails so I can use
> ActiveRecords, and also because it feels like the correct thing to do? I
> then need to work out how to change the setters in Active record, or maybe
> not, but at the moment I simply am trying to work out where the methods go.

Uh. That whole paragraph is such a mish-mash that it leads to me
believe that you don't have a clear picture of the MVC pattern that
Rails embodies.

Foe one thing, classes ("models") derived from ActiveRecord are
just that, models, *not* controllers. Controllers do not "map to tables".

You might want to, as Colin suggested, run through a tutorial before
going any further.

Then decide if it makes sense to combine your data import function
with the Rails *data display* function.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yCeEY9MOcozwRb_%3DMGjOwanryK9of_O8qFQ8K_fJR-n_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment