最新文章列表

rails tips

rails3.2  没有匹配上的路由,统一跳转到一个地址: get '*path', via: :all, to: 'home#app' get '*path', via: :all, to: 'home#render_404' ruby-china上使用的是match match '*path', via: :all, to: 'home#app' match '*path', via: :a ...
michael_roshen 评论(0) 有88人浏览 2016-07-07 16:04

goliath 1.0.4 解决自定义路由

goliath从1.0版本以后,因为routes存在bug,开发者还没有找到合适的解决方法,暂时把routes这部分功能给禁掉了,那么我们可以通过一下的方法来自定义路由:   require 'rubygems' require 'goliath' require 'em-http' class HttpLog < Goliath::API use ::Rack::Rel ...
michael_roshen 评论(0) 有77人浏览 2015-05-18 15:05

Rails route constraints api 介绍

Rails 为route的路由约束提供了constraints 方法,具体的使用如下: 限制IP地址constraints(:ip => /192.168.\d+.\d+/) do resources :posts end  可以提供一个ip或者一个ip地址的范围进行限制,一旦检测到用户的ip地址符合限制范围,则会告知不存在此route。 匹配动态请求这个例子是控制rou ...
lanrion 评论(0) 有1658人浏览 2013-07-21 17:15

Camel Routes

Routes Camel supports the definition of routing rules using a Java DSL (domain specific language) which avoids the need for cumbersome XML using a RouteBuilder. For example a simple route can be cr ...
justice_jl 评论(0) 有1149人浏览 2013-01-15 15:57

Sencha Touch2 后退按钮的导航应用

Sencha Touch2 后退按钮的导航应用 系统中设置几个routes的路由 routes: { 'form/:id':'showFormDetailByDocId', 'flow/:id': 'showDetailById', 'menu/:id': 'showMenuById', 'fl ...
peter2009 评论(1) 有4923人浏览 2012-05-29 16:13

用RSPEC测试路由

基本 require "spec_helper" describe "routes for Widgets" do it "routes /widgets to the widgets controller" do { :get => "/widgets" }. should ...
夜鸣猪 评论(1) 有1341人浏览 2012-03-28 08:20

5.2 rails routes

1. the purpose of rails routes:   a. recognize url, and dispatch to correct controller and actions b. generate named routes, i.e. paths and urls, so the you needn't hardcode them in views   2. the ...
peryt 评论(0) 有884人浏览 2011-09-03 10:20

5.2 integration test using rspec.

in this chapter,we will see a very simple integration test to test routes in rails.   controller test is only able to test routes inside the controller, so if you want to test global routes, like hom ...
peryt 评论(0) 有982人浏览 2011-09-01 09:21

routes, add links to views

this chapter is very simple.   in previous chapters, we just use "#" as the url in the links.   now we will fill with actual link urls   1. we can hard code to: <a href="pages/ ...
peryt 评论(0) 有893人浏览 2011-08-31 10:02

Rails 2.3.12下遇到的named route的诡异问题

周五的时候把网站升级到Rails 2.3.12,本来在本地测试都没有问题的,但是在服务器上遇到一个非常诡异的问题,足足用了一天一夜的时间。 本地:   Mac OS X 10.7,Ruby 1.8.7,Rails 2.3.12 服务器:Ubuntu 8.04,Ruby Enterprise Edition 1.8.7,Rails 2.3.12 在服务器上,但凡是在 routes.rb 里面定义的 ...
yangzhihuan 评论(0) 有1619人浏览 2011-08-14 21:18

最近博客热门TAG

Java(141744) C(73651) C++(68608) SQL(64571) C#(59609) XML(59133) HTML(59043) JavaScript(54919) .net(54785) Web(54514) 工作(54118) Linux(50905) Oracle(49875) 应用服务器(43289) Spring(40812) 编程(39454) Windows(39381) JSP(37542) MySQL(37267) 数据结构(36424)

博客人气排行榜

    博客电子书下载排行

      >>浏览更多下载

      相关资讯

      相关讨论

      Global site tag (gtag.js) - Google Analytics