Created
April 14, 2009 18:04
-
-
Save sprite2005/95321 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def verify | |
@phone_number = current_user.phone_numbers.find(params[:id]) | |
if @phone_number | |
begin | |
adhearsion = DRbObject.new_with_uri "druby://vipwithme.com:9050" | |
rescue | |
connection_error = true | |
end | |
if !connection_error | |
@phone_number.start_verification! | |
adhearsion.verify_number_request(@phone_number.id) | |
end | |
end | |
respond_to do |format| | |
format.js { | |
render :partial => 'verify', :locals => { :number => @phone_number } | |
} | |
end | |
rescue | |
flash[:error] = "An error occured" | |
render :inline => flash[:error], :status => 500 if flash[:error] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment