Is there an easy way to create error messages and display them in the view without using a model from ActiveRecord. I just quickly added a temporary new field to a form that I have no desire to store in the db and will probably remove it shortly. I used text_field_tag on the view which doesn''t require a model but if it''s not provided by the user I still want to return the error message to the view. I was just hoping for a simple way to return error messages to the view without having to add them to a model. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
http://api.rubyonrails.com/classes/ActionController/Flash.html -faisal On Apr 25, 2007, at 11:36 PM, Eric Northam wrote:> > Is there an easy way to create error messages and display them in the > view without using a model from ActiveRecord. I just quickly added a > temporary new field to a form that I have no desire to store in the db > and will probably remove it shortly. I used text_field_tag on the view > which doesn''t require a model but if it''s not provided by the user I > still want to return the error message to the view. I was just hoping > for a simple way to return error messages to the view without having > to add them to a model. > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Eric, Eric Northam wrote:> Is there an easy way to create error messages and display them in the > view without using a model from ActiveRecord. I just quickly added a > temporary new field to a form that I have no desire to store in the db > and will probably remove it shortly. I used text_field_tag on the view > which doesn''t require a model but if it''s not provided by the user I > still want to return the error message to the view. I was just hoping > for a simple way to return error messages to the view without having > to add them to a model.It sounds like the flash method, probably along with some logic to redirect_to :back in the case of an error, should give you what you''re looking for. hth, Bill --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---