Displaying 2 results from an estimated 2 matches for "recipient_email".
2010 Feb 10
16
nil object - can anyone help?
...,
I''ve been looking for a while now and can''t seem to find where I''m
going wrong..
I''m following a railscast tutorial to send invites out to people.
there''s n invitation.rb page:
class Invitation < ActiveRecord::Base
#attr_accessible :sender_id, :recipient_email, :token, :sent_at
belongs_to :sender, :class_name => ''User''
has_one :recipient, :class_name => ''User''
###validation
validates_presence_of :recipient_email
validate :recipient_is_not_registered
validate :sender_has_i...
2011 Mar 17
7
Beta Invitation in Rails 3, little problem
...HE FOLLOW SCRIPT
#app/models/invitation.rb #how generate the token
class Invitation < ActiveRecord::Base
belongs_to :sender, :class_name => ''User''
has_one :recipient, :class_name => ''User''
email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :recipient_email, :presence => true,
:format => { :with => email_regex }
before_create :generate_token
private
def generate_token
self.token = Digest::SHA1.hexdigest([Time.now, rand].join)
end
end
#/mailers/invitation.text.rb
You are invited to ExampleApp.com click below to signup
&l...