Thanks, Sijo. That works. I would like to move this logic down to the model level but I can't because the transaction involves different models. Any suggestions? Thanks.
On Jul 7, 2:31 am, Sijo Kg <rails-mailing-l...@andreas-s.net> wrote: > > ActiveRecord::Base.transaction as the full name indicates is is not > > available in ApplicationController . > > Did not get the above statement..Anyway you can do like > > def controller_action > > begin > ActiveRecord::Base.transaction do > ---------your all transactions here > end > rescue ActiveRecord::ActiveRecordError => e: > ---------- rescue code here > else > ----------in case nothing raised > end > > end > > But better to move this to model so to make controller skinny > > Sijo > -- > Posted viahttp://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 rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---