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

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

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

  • 资源大小:18.30 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分: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