I am trying to change a rails value with ajax and I am having trouble. Here is what I have so far.
ajax
$(button).click(function(){
$.ajax({
url: '/change_value',
type: 'GET'
})
});
Controller
def home
@value = 0
end
def change_value
@value = 1
end
routes
get '/change_value', to: 'static_pages#change_value'
Thank you for all the help.