ruby::conditions => “LIKE ___%” syntax
2013-09-12 17:46
288 查看
The following gives an error:
The following is OK:
I am wondering where I can find the documentation for the
%) syntax.
ArgumentError: malformed format string - %':
[code] named_scope :sales, :conditions => ["rolename LIKE 'salesteam%'"]
The following is OK:
[code] named_scope :sales, :conditions => ["rolename LIKE 'salesteam%%'"]
I am wondering where I can find the documentation for the
%%(double
%) syntax.
相关文章推荐
- iOS 9 导入类库全面详尽过程(Ruby安装->CocoaPods安装->导入类库)
- Ruby paperclip: says it needs version >= 1.9.2, but I have 1.8.7
- 重构基本概念--->ruby重构有感(一)--未完待续!!!
- 利用Radrails开发Ruby on Rails程序入门指南------->成功
- spring data jpa中@Query中的模糊查询<like关键字>
- 重构基本概念--->ruby重构有感(一)--未完待续!!!
- 代码中的坏味道-->ruby重构有感(二)--未完待续!
- 安装 Ruby运行环境----> CocoaPods安装和使用图解
- mysql like 查询 有单引号的处理办法。org.hibernate.QueryException: expecting ''', found '<EOF>' [SELECT DISTINCT
- ASP.NET MVC 3: Razor’s @: and <text> syntax
- ASP.NET MVC 3: Razor’s @: and <text> syntax
- Ruby on rails 实战圣经:Part 1: 入门导览->Ruby on Rails 简介
- New <%: %> Syntax for HTML Encoding Output in ASP.NET 4 (and ASP.NET MVC 2)
- MySQL中like语句及<>相关优化器tips
- 关于SyntaxError: syntax error <!doctype html>
- python print'hello' File "<stdin>",line 1 print 'hello' SyntaxError:invalid syntax
- Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update --system` and try again.
- Redis学习笔记(六)—— 解决安装ruby出现的问题:redis requires Ruby version &gt;= 2.2.2.
- 也比较一下PG中的like查询: like '%<str>%'