首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 复杂,动态的条款,容易(和安全)

复杂,动态的条款,容易(和安全)

  • 资源大小:18.30 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: sql activerecord plugin rails

资 源 简 介

RAILS 2.0 READY! Version 1.2 - released Oct 30, 2007. ChangeLog Overview Do you have a query conditions that look like this? “(name like ‘tim%’) and (age < 10) and (category=’friends’ or category=’family’)” Do you need a way to easily build these queries, with the ability to add more or less conditions based on user input? Enter [RailsWhere] Installation script/plugin install http://railswhere.googlecode.com/svn/tags/railswhere Example Usage Simple User.find(:all, :conditions => Where{|w| w.and "first_name like ?", "#{first_name}%" if params[:first_name] w.and "last_name like ?", "#{last_name}%" if params[:last_name] } Nested conditions ``` w = Where.new for field in [:first_name, :last_name, :phone, :email] w.and("#{field} like ?", params[:s
VIP VIP
  • Zzz 1天前 成为了本站会员

  • Katou Megumi 1天前 成为了本站会员

  • 1天前 成为了本站会员

  • 流浪 1天前 成为了本站会员

  • 也是一生 1天前 成为了本站会员

  • king666 2天前 成为了本站会员

  • ﹏約啶℡ 2天前 成为了本站会员

  • Long for 2天前 成为了本站会员

  • 2天前 成为了本站会员

  • 金. 2天前 成为了本站会员

0.170384s