【发布时间】:2014-02-21 11:31:09
【问题描述】:
我正在查询 Shopify 开发商店数据库,它可以正常返回商品,但“订单”参数似乎不起作用(“限制”参数起作用)...
home_controller.rb
if params[:search]
# get 10 products via search parameter and order by title ascending
@info['products'] = ShopifyAPI::Product.where(title: params[:search], :params => {:limit => 10, :order => "title ASC"})
else
# get 10 products and order by created_at descending
@info['products'] = ShopifyAPI::Product.find(:all, :params => {:limit => 10, :order => "created_at DESC"})
end
我尝试过“ASC”和“DESC”。你知道我哪里出错了吗?
【问题讨论】:
-
ShopifyAPI 是否可能无法完全理解来自 Rails 4 的查询?
标签: ruby-on-rails api ruby-on-rails-4 shopify