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 =>
‘verify’

my plan was to make something like this work:
http://www.site.com/verify/[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]”)
=> “a%40a.com

rs.recognize_path ‘/verify/a%40a.com/akey
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”}

help!

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