Now we want to work on the details page for that, what we will do is we will display all the product
details on that page and then for those product details, we will ask the user how many products you
want to add to the shopping cart.
So let's go back to our controller inside the home controller.
Let me stop this.
We will copy the index action method and we will create a detailed action method inside detail.
We do not warrant a list.
We just want a single product.
So we would retrieve that, and I can call this as a product rather than get all.
We will have to get first our default.
In the action method here, we will receive an I.D. for which we won't to view the details.
So inside the gate first our.
We will have our link expression you close to you that it is equal, equal to the I.D. We will return
back our product model.
No one checked the details page.
We also need the number of account that user wants for that product in their shopping cart.
So we need to create a few model since product will not be sufficient.
And once the user adds that, we will be adding that to the shopping cart.
So it makes sense to create a view model.
I recall that as a shopping cart, we can make that a public class video prop here.
We will have a product and we will collect the same.
Next, what we want is count for that product.
So we're going to do prop integer where we'll have count here and we will act arrange validation that
it must be between one and 2000.
That looks very far now.
Likely we will come back and modify our shopping cart in the future radios right now.
If we go to our home controller here, we can create a shopping cart object.
Let me press control dot.
That's will we cart.
OPG is equal to nil.
And within the parameters here, we will assign those to product.
So product is equal to the product here, and I want count to be defaulted to one.
So right here we can set count is equal to one.
That's perfect.
Whether it would turn the card OPG to The View, and I'd say this in the next video, let's create the
detailed view and display all the details.