Forum: Ruby on Rails How to use flash in ROR.......

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Prashant T. (Guest)
on 2006-03-13 08:56

How to use flash[:notice] in ruby to display error messages.
I have tried it into for loop as follows:-
 for i in 0..(params[:product][:count].to_i-1)
  if params[:product]['demand'+(i).to_s].to_i >
	flash[:notice] ="#{params[:product]['demand'+(i).to_s]}  is less than
redirect_to :action => 'index', :id => @product

Here in above code when i get redirected to index action (on
index.rhtml) page I can see only erro rmesage asociated with last flash.
That is in above code i want to store message into flash for all
products for which above 'if' condition becomes true. So that i can
iterate throgh flash & see the error messages related with all products
for which 'if' condition true.

How to do this?????

Thanx in advance.

This topic is locked and can not be replied to.