Challenge for Presenting Products

Challenge

The path in a Rails route can contain multiple parameters. For example, a more complex route could look like this:

categories/:id/products/:product_id

This would be used to store 2 different params. Assume the above route maps to the following controller action:

def show
  @pid = params[:product_id]
end

What will be the value of @pid when you visit categories/45/products/82?

Please sign in or sign up to submit answers.

Alternatively, you can try out Learneroo before signing up.

Contact Us
Sign in or email us at [email protected]