Need to verify email address - help!

not sure if this is the best way to go about it, but i’m generating a
key that gets sent to a person’s email and then ask them click on the
link to verify the key.

routes.rb then looks like this for me:
map.connect ‘verify/:email/:key’, :controller => ‘user’, :action =>

my plan was to make something like this work:[email protected]/akey

i thought i could use CGI.escape and CGI.unescape to generate the
proper URL but it gets stuck at the period in the [email protected] part and
gives me this:

ruby script/console

rs = ActionController::Routing::Routes
s = CGI.escape(“[email protected]”)
=> “

rs.recognize_path ‘/verify/
ActionController::RoutingError: no route found to match “/verify/
[email protected]/akey” with {}
from /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/
action_controller/routing.rb:1292:in `recognize_path’

but this works, (so it’s getting stuck at the period in [email protected])

rs.recognize_path ‘/verify/a%40a/akey’.
{:action=>“verify”, :email=>“[email protected]”, :key=>“akey”, :controller=>“user”}


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs