Reputation: 1461
I have the following code in my controller:
def show
@activity = current_user.activities.find(params[:id])
if graph.good_data?(params)
graph.time_frame(params)
else
flash[:error] = "Please enter valid data."
graph.default
end
end
When I enter invalid data flash[:error]
receives a message and everything is displayed accordingly. If I enter valid data after I entered invalid data the action performs as it is supposed. graph.time_frame(params)
does it's job. However the flash[:error]
message persists with this next request. If I enter valid data again the flash[:error]
message disappears. Does anybody know why this is happening?
Upvotes: 0
Views: 118