public
Created

Adding SMS capabilities to your Rails Application

  • Download Gist
verifications_controller.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
class VerificationsController < ApplicationController
 
before_filter :get_user
 
def create
@user.update_attribute(:verified, true)
# You could send another message acknowledging the verificaton
head :ok
end
 
private
def get_user
unless @user = User.find_by_phone(params['From'])
head :not_found
end
end
 
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.