Im new to Ruby on Rails and I’m sure this is Simple Simon question.
Trying to do a sql select where based on a url param
This works fine and displays what I want but I want to change the 1
to a url param
def list
@product = product.find_by_sql ["SELECT * FROM products WHERE
category_id = 1"]
end
Parameters: {“id”=>“1”}