2017-02-16 45 views
1

我正在使用高级搜索搜索,我希望当用户选择搜索属性时,他/她可以从下拉列表中选择一个值/值框中的预填充列表。就像选择框一样。Rails +搜索引擎。如何根据选定的属性自定义值域,包括搜索中的关联

我该怎么做?

这里是我的_condition_fields.html.erb代码:

<div class="field"> 
    <%= f.attribute_fields do |a| %> 
    <%= a.attribute_select associations: [:category] %> 
    <% end %> 
    <%= f.predicate_select %> 
    <%= f.value_fields do |v| %> 
    <%= v.text_field :value %> 
    <% end %> 
#something like this here 
<%= f.select, options_for_select(SELECTED_ATTRIBUTES_ALL_VALUES), include_blank: true %> 
</div> 

select box or pre-define values in highlight fields

+0

我得到了同样的问题。你知道吗? –

回答

1

你应该努力使自己的UI。 Ransack不支持这一点。