Forum: Ruby on Rails [AWDwR] Make flash[:notice] go away

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.
Randy W. Sims (Guest)
on 2006-06-14 05:35
(Received via mailing list)
Following the tutorial app in Agile Rails, I'm trying to figure out the
best way to get the flash notice to go away after an "Invalid product"
is selected (eg. when a new, valid product is selected). This is after
Task D, Chapter 9, in the 2nd Ed Beta.

I've come close to getting to work right, but I think I may still be
missing something in the control flow of Rails apps. The layout
"store.rhtml" displays a 'div' if there is a flash message. I think this
needs to be made permanent. The 'add_to_cart' action in the 'store'
controller needs to run some javascript to hide or display the 'div' if
there is anything to show, rather than do a redirect, or should it go in
"add_to_cart.rjs"? The latter is what I've got almost working, but I get
errors in some cases because of undefined object. This is where I don't
think I have a complete handle on the control flow of rails yet.

Thanks,
Randy.
This topic is locked and can not be replied to.