ruby on rails - Difference between flash.now and @instance_var -
i'm wondering difference between using flash.now
, using instance variable (e.g. @error_message
)?
on related note, how flash
work when have multiple servers running, , there's probability subsequent request executed different server?
i'm wondering difference between using flash.now , using instance variable (e.g. @error_message)?
effectively not difference since both values gone after request completes. think it's more of convenience view code can check 1 place error messages instead of having check both flash
, instance variable.
on related note, how flash work when have multiple servers running, , there's probability subsequent request executed different server?
the flash
lives in session, typically persisted database. if have multiple instances of rails app running , using same database, have shared access flash
object. it's therefore not problem @ if server writes flash
object , server b reads out on next request.
Comments
Post a Comment