Adding a point system

Hey, how do I put together a point system where users get points when their items have been sold? In this case users could then use the points gotten redeem prizes.

Posted almost 4 years ago by JrK
Posted almost 4 years ago by Alex Yang

You'll need to add a 'points' column to your User and Listing/Product databases. This column should default to zero for new Users. Then, you'll need to either update or add a few actions to your controller to implement all the things you can do involving points. For example, you'll probably need to add some code to your 'create' action in your OrdersController so that when a new Order is created, the seller is awarded the number of points assigned to that Listing/Product. Similarly, you'll need to have an action for users to redeem their points for prizes. Hope that helps!

1
Posted almost 4 years ago by JrK

Are there any things such as gems that could get me closer and point in the right direction?

1
Posted almost 4 years ago by Alex Yang

Hmm...not that I know of. If you don't feel comfortable with making these changes yet, I'd recommend spending some more time becoming familiar with the concept of MVC. Understanding how the models, views, and controllers interact with each other and what happens when you change the code of each one is the hardest thing to learn about Rails, but it'll also make everything seem easier afterward. I'd recommend reviewing the Etsydemo/Yelpdemo courses - specifically, going over videos on topics like adding a column to a database, or adding a new action to a controller will be very useful for you. If you have specific questions about any of the above or MVC in general, you can also ask me.

1