Forum: Ruby on Rails Controller-tier errors

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ee7be48e775d357de69db2754a377160?d=identicon&s=25 Cory Wilkerson (corywilkerson)
on 2005-12-02 17:19
Sorry for the pseudo-repost, maybe I didn't do a good enough job
explaining it the first time around or maybe I'm an island unto myself
;)

So - simplified this time around:

Given the following method:

def do_login
  if Account.find_some_account(foo, bar)
     redirect_to :controller => 'xxx'
  else
     #### I'd like to inform the user here that we've had an issue...
     #### I could just use flash, but I'm wondering what I should do
     #### if I want to report back multiple errors...is it considered
     #### bad-form to return an @errors array from the controller tier?

     redirect_to :controller => 'xxx', :action => 'display_create'
  end
end

Thanks for any help!  Interesting to see how quickly this list moves!
Cory Wilkerson
41165a7e7126d616a0ae0762e00718e2?d=identicon&s=25 bigsmoke (Guest)
on 2005-12-03 14:35
(Received via mailing list)
On 12/2/05, Cory Wilkerson <coryw@americanmonkey.com> wrote:
>      redirect_to :controller => 'xxx'
>   else
>      #### I'd like to inform the user here that we've had an issue...
>      #### I could just use flash, but I'm wondering what I should do
>      #### if I want to report back multiple errors...is it considered
>      #### bad-form to return an @errors array from the controller tier?
>
>      redirect_to :controller => 'xxx', :action => 'display_create'
>   end
> end

I see no reason why you couln't put more than one error in the flash.

Good luck,

 - Rowan
This topic is locked and can not be replied to.