On Oct 15, 9:27 am, Sijo Kg <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> @problem.save! So suppose an error happens I have redirected to the > same view which contains error_messages ..But my problem is I dont ge > the error messages when redirect but get it when render the same > > redirect_to :action => ''create_ui'' #This dies not give error messagesBecause the state of the invalid object is lost when you do a redirect (which is why people typically don''t do a redirect) Fred> for problem > render :action => ''create_ui'' #This gives error messages for problem > Why this happens ?Please help > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Thanks for the reply.Why I used the redirect because I first used render But In the view I have some check boxes One of them like <%= select( "problem", "problem_urgency_id", ProblemUrgency.find(:all).collect {|p| [ p.name, p.id ] },options ={:prompt => "<< Select any >>"}) %> So in the above if I use render(if error happens) what happens is that << Select any >> is not shown and only the values from the problem_urgencies table are shown That is why I used the redirect_to But it has this problem(Not problem actually)..Could you please suggest how I can solve this? Thanks in advance Sijo -- 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 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 -~----------~----~----~----~------~----~------~--~---