I finally got it working. I went to a local ruby on rails meetup and got
some help on the issue.
I needed to use current_user.id and params[:product_id] for my parameters
in my function.
Thanks,
Joe
On Thursday, February 16, 2017 at 5:51:29 PM UTC-5, Walter Lee Davis wrote:
>
>
> > On Feb 16
> On Feb 16, 2017, at 9:27 AM, Joe Guerra wrote:
>
> ok, still confused
> I've defined my parms like this...
>
> def cart_params
> # params.fetch(:cart, {})
> params.require(:cart).permit(:user_id, :product_id )
>
>
> end
>
>
> Have this in my controller.
>
> def add_to_cart
On Wed, Feb 15, 2017 at 4:11 PM, Joe Guerra wrote:
> I've got this in my product show pageI'm trying to pass user_id &
> product_id to my products controller, add_to_cart method...
Accepting user_id as an untrusted input from the client is a
Very Bad Idea. If it's a value saved in session yo
I am pretty close to figuring this out...
I've got this in my product show pageI'm trying to pass user_id &
product_id to my products controller, add_to_cart method...
<%= button_to 'Add to Cart', {:controller => "products", :action =>
"add_to_cart", :user_id=> session[:user_id], :product
4 matches
Mail list logo