Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion redirect for routes
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
soffolk Zhu  
View profile  
 More options Oct 16 2012, 10:24 pm
From: soffolk Zhu <zlx.s...@gmail.com>
Date: Tue, 16 Oct 2012 19:24:24 -0700 (PDT)
Local: Tues, Oct 16 2012 10:24 pm
Subject: redirect for routes

ModuleActionDispatch::Routing::Redirection

   - actionpack/lib/action_dispatch/routing/redirection.rb <../../../files/actionpack/lib/action_dispatch/routing/redirection_rb.html>

match 'jokes/:number', :to => redirect do |params, request|
  path = (params[:number].to_i.even? ? "/wheres-the-beef" : "/i-love-lamp")
  "http://#{request.host_with_port}/#{path}"end

the example can not work in rails 3.2.2

can anyone can help me?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.