|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Help w/ errors.add_to_base between controller and model
Help w/ errors.add_to_base between controller and model
Hello, I'm having trouble in routing some errors between model and controller. The errors produced in the controller (invite_controller.rb) are collected and spit out nicely in a flash[:validate] method as such: Code:
if errors.size > 0
flash[:validation] = errors.join('<br />')
end
Errors produced in the model (invite.rb) are displayed w/in a giant page failure explosion and are not routed into the flash[:validate] method. The code for the the method is as follows: Code:
self.errors.add_to_base("an invitation has already been sent to
#{email}")
Is there a way where I can route the model errors to the flash[:validate] method as I am in the controller? Thanks for your help! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Ruby Programming > Help w/ errors.add_to_base between controller and model |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|