In my model I have results
store_accessor :results
and in controller its like
if current_user.test
@results = current_user.test.results
end
And I am printing this value at the front end it keeps showing 0
def update
stats = user.test
stats.data_will_change!
attributes = { results: "#{(stats.results.to_i) + 1}" }
stats.update_attributes(attributes)
end
It's going through the function but the value at the front-end is still 0