My controller finds a user using:
@user = User.find_by_identifier!(params[:id])
In my Users model, i have
class User < ActiveRecord::Base
def to_param
identifier
end
private
def create_identifier
SecureRandom.urlsafe_base64(9)
end
end
Question: Is this safe from an SQL injection point? And how so, since I have no clue about SQL injection despite reading various articles.