Ruby on Rails Saturday, December 23, 2017

On Fri, Dec 22, 2017 at 4:16 PM, André Luiz Abdalla Silveira
<andreluizsa00@gmail.com> wrote:

> Biggest of them is trying to make a match simulation method (I
> didn't think a view was necessary for it). This method is in
> matches_controller.rb, but again, there isn't any view for that. How do you
> think I should handle it?

I think you should read as much as possible about Object-Oriented
programming right away :-)

"Practical Object-Oriented Design in Ruby (POODR)" by Sandi Metz
is a good intro, but there are lots of other resources online.

That "simulate" method does NOT belong in a controller, it belongs
in a model, and I would also recommend you step back and try to
describe the problem(s) you're trying to solve in the form of tests,
breaking the steps down as much as possible. Flowcharting on a
whiteboard or sheet of paper might be useful too.

Good luck!

--
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/CACmC4yAQ7FbUS06VZOoxF7ms0F-Dc8AcSy8DBFKJW4r5DYSBUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment