I’m new here- here’s the background on my question:
- I’m building a cart
- I’m also reading “Agile Rails Development”
- Controller is “store_controller.rb”
- View “index” displays products, only the image, no other detail
- My desired functionality is that the user clicks the image in the
index view and gets the view “details”, which is where the product can
be added to the cart.
I don’t have a lot of experience with the MCV model that Rails is all
about, so I’m having trouble getting the conceptual idea of what I need
to do to pull this off. My questions are:
- What definitions and methods to I need to put in the controller
“store_controller.rb”, the model “product.rb” and - How do I make them work together with the views “index” and
“details”?
Thank you so much for your help, I’d rather learn how to think about
this correctly and get a level of elegance in my code than beat my head
against the wall making something “work”.