HttpClient做接口测试时自定义参数长度
2016-01-14 13:49
471 查看
Searchlogic makes searching models easier than ever with its assortment of named scopes. In this episode I show you how to create simple and advanced searches.
sudo gem install searchlogic # config/environment.rb config.gem "searchlogic" # script/console ActiveRecord::Base.logger = Logger.new(STDOUT) Product.name_like("Video") Product.name_not_like("Video").price_gt(5).price_lt(200) Product.name_like_any(["couch", "table"]) Product.name_like_all(["video", "console"]) Product.category_name_like("elect") Product.search(:category_name_like => "elect", :price_lt => "100") s = _ s.all s.name_like("video") Product.ascend_by_name # products_controller.rb @products = Product.name_like_all(params[:search].to_s.split).ascend_by_name # or @search = Product.search(params[:search]) @products = @search.all <!-- index.html.erb --> <% form_for @search do |f| %> <p> <%= f.label :name_like, "Name" %><br /> <%= f.text_field :name_like %> </p> <p> <%= f.label :category_id_equals, "Category" %><br /> <%= f.collection_select :category_id_equals, Category.all, :id, :name, :include_blank => true %> </p> <p> <%= f.label :price_gte, "Price Range" %><br /> <%= f.text_field :price_gte, :size => 8 %> - <%= f.text_field :price_lte, :size => 8 %> </p> <p> <%= f.submit "Submit" %> </p> <% end %> <p> Sort by: <%= order @search, :by => :name %> | <%= order @search, :by => :price %> </p>
相关文章推荐
- Android网络加载框架:Picasso简介
- http client transfer
- Android网络图片三级缓存
- Android Asynchronous Http Client的用法实例(详解+源码)
- HTTP method GET is not supported by this URL
- 使用Go语言+goproxy库编写的http代理服务器+图片cache保存脚本 第一版完成
- HTTP和HTTPS的区别
- Jetty开发指导:HTTP Client
- LIVE555研究之二: RTSP、RTP/RTCP协议介绍
- TCP FLAG 标记
- WCF NetTcpBinding 由于系统缓冲区空间不足或队列已满,不能执行套接字上的操作
- HTTP状态管理机制之Cookie(转)
- qt TCP传输字符串
- 使用tcpdump观察ARP通信过程和ARP报文详解
- flaping翻动路由
- Android中网络流量控制(防火墙)——Iptables
- Android中OKHttp保存Cookie并传入WebView
- 在.Net MVC结构API接口中判断http头信息实现公共的权限验证过滤器示例
- 用 Java 实现断点续传 (HTTP)
- [转]HTTP Header 详解