ransack - Rails page search form: default parameters -


i have 2 rails sites, bargain stock funds (http://www.bargainstockfunds.com) , doppler value investing (http://www.dopplervalueinvesting.com).

bargain stock funds has search feature allows users obtain list of funds meeting criteria. (the url http://www.bargainstockfunds.com/funds .) doppler value investing has search feature allows users obtain list of stocks meeting criteria. (the url http://www.dopplervalueinvesting.com/stocks/ .) both sites use ransack gem provide search feature , kaminari gem paginate results.

is there way can configure search engines pre-loaded criteria set? bargain stock funds, want search engine pre-configured exclude funds load_front or load_back value greater 0.0%, , want results sorted respect value of pcf parameter. doppler value investing, want search engine pre-configured exclude funds pass_legit value of false or pass_quality value of false, , want results sorted respect value of dopeler_pb parameter. these pre-configured settings save user trouble of having hunt around criteria in drop-down menus.

the source code search form bargain stock funds is:

<%= search_form_for @search, url: search_funds_path, method: :post |f| %>   <%= f.condition_fields |c| %>     <%= render "condition_fields", f: c %>   <% end %>   <p><%= link_to_add_fields "add conditions", f, :condition %></p>   <div class="field">     sort:     <%= f.sort_fields |s| %>       <%= s.sort_select %>     <% end %>   </div>   <div class="actions"><%= f.submit "search" %></div> <% end %> 

the source code search form doppler value investing quite similar. (just replace "funds" "stocks".)

not sure i'm following. "search engine" mean google? or mean applications searching logic?

if latter, may help: https://stackoverflow.com/a/14553363/1797331

i'll have check out sites. developing similar, focused on stock fundamentals -- haven't done lately. might inspire me.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -