我想搜索的點擊搜索這兩個類別和地點有多個選項(搜查)如何搜索上的點擊通過搜查搜索提交
我看來
<%= form_tag location_path, :method=>'get' do %>
<%= select_tag :q, options_from_collection_for_select(Category.all, :id, :name, params[:q]) %>
<%= text_field_tag :q, nil,:placeholder=>"Tell us what you are looking for.." %>
<input type="submit" value="SEARCH" class="btn1 home-search-button" >
<% end %>
def location
q = params[:q]
@key=q
@property = Property.ransack(location_or_category_name_cont: q).result(distinct: true)
end
this search searches only location not category,
on executing i am getting like this,
`url is like this : http://localhost:3000/location?utf8=%E2%9C%93&q=2&q=banglore`
命令IAM讓上執行 ` 這是搜索班加羅爾的類別名稱及位置(應該搜索「商業」爲CATEGORY_NAME(這是在CATEGORY_ID:2)instaed班加羅爾」的
任何幫助是appreciatable
當我試圖這樣 – SreRoR
是它的工作? –
沒有一些查詢錯誤。我更新了我上面的終端屏幕截圖。請檢查 – SreRoR