Looking for a way to notify the user, via a flash message, that they've obtained a new badge.
I have my observer setup per the instructions here: https://github.com/merit-gem/merit#getting-notifications
My observer code is:
class ReputationChangeObserver
def update(changed_data)
description = changed_data[:description]
flash[:info] = description
end
end
Rails complains about the following:
undefined local variable or method `flash' for #<ReputationChangeObserver:0x0000000586d648>
I understand that flash is a part of the base actioncontroller. However, I don't know how the observer could access flash or session since it seems to exist outside of the rails framework.
What am I missing? There don't seem to be any examples or tutorials on how to implement user notifications (that I could find).
Would someone please lend their wisdom?