我有两个型号作为:
Product { has_may variants}
Variant {belongs to product}
我使用了Sunspot搜索,在结果中我检索了选定的变体,现在我想要这个结果,因为我的搜索结果包含了搜索检索到的每个产品的一个或多个变体。
搜索代码示例如下:
@search = Sunspot.search(Spree::Variant) do
keywords params[:keywords]
with :is_active, true
with :deleted_at,nil
if params[:ah].presen
我正在用下面的代码获取产品类型,这些代码工作得很好。我的问题是有多个.type。我想调用特定.type的代码。类型的父div是.row' and each.rowhas unique row id. I would like to pass $(".type").val()表示的.row id。
如何做到这一点。
$(function() {
function log(message) {
$("<div>").text(message).prependTo("