Ruby on Rails Tuesday, June 30, 2015

Yes but I also call those method from the Class method rank and it needs to save.

This is always my dilemma, just exactly what or how much code should go into controller and model?
Like in my example, before when I had everything in the controller, people suggested that I put that code in the model.
So I did. But now, people are suggesting I take some code back out to the controller.

So exactly which part should go into the controller and which part belongs to the model?

Having said that, I do agree the self.save should be in the controller but this will break my self.rank Class method. Arrrgh!

Any suggestion how I can break down the self.rank Class method so I can put the self.save into the controller?


Thanks


On Tuesday, June 30, 2015 at 2:07:40 AM UTC-5, Ruby-Forum.com User wrote:
Maybe take out the save from rankup and rankdown and save in the
controller?

--
Posted via http://www.ruby-forum.com/.

--
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/9bdd8729-4f78-4a40-a704-5b1d8b47f98e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment