rails order

# Assuming you have a Rails model named "Product" with a column named "price" 

# Fetch products and order them by price in ascending order
@products = Product.order(price: :asc)

# Fetch products and order them by price in descending order
@products = Product.order(price: :desc)