searchLogic心得

阅读更多
searchLogic好用的查询插件:
belongs_to :conversation
has_many :people


在conversation/advsearch中能这样查询people中的字段:
text_field_tag "search[people_name_like]", params[:search][:people_name_like], :is_focus => true, :class => :nofixed


如果是本表的字段可以这样:
text_field_tag "conversation[tag ]", params[:conversation][:tag], :is_focus => true, :class => :nofixed

text_field_tag "search[tag _like ]", params[:search][:ta g_like ], :is_focus => true, :class => :nofixed

=calendar_date_select_tag "search[reported_at_gte]",params[:search][:reported_at_gte], :popup=> :force, :class=> "calendar_report nofixed"


在共用一个文件时,有些页面不用查询某些字段:
- unless defined?(without) && without.include?(:state)

列表页面加:=render :partial => 'advsearch', :locals => {:without => [:creator, :manage, :dispatched_at, :destroy_adv]}

所产生的链接为:=link_to_function '高级查询', "newDiv('adv-search')", :class=> "icon-16px-box j-icon i-view"





你可能感兴趣的:(Java,J#)