In controller I use to raise some specific error as follows :

include CustomErrors

rescue_from NoGuestFound,NoHostFound,NoInvitation,WrongPass do |e|
  flash[:message] = e.message
  redirect_to :action => :index
end

def lambda
  ...
  @guest.is_invited_by?(@host) or raise CustomError1.new 'context
message'
  ...
end


I find this way of doing pretty OK, but for AR model validation I'd like
to give back the end to the Active Record standard validation process. I
can't find good doc on how to do so and how AR validation works
exactly...

if anybody has a better way to deal with error handling or if you could
give me some smart links, would appreciate !
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to