I have a div that I hid when a user clicks the link and shows when they click it again. We want that div to be collapsed when the user comes back if they chose to hide it so we added a boolean column hide_todo in our user database and I added a method to test the value in the user_controller. The hiding is done with jQuery and we want to change the value of hide_todo to true if the user clicks Hide and false when the user clicks Show. How would I access a Ruby variable in the application.js?
I have a div that I hid when a user clicks the link and
Share
Well we ended up using
$.get('toggle_hide');, adding a method to the controller to toggle the boolean and mapping that to the resources inroute.rb. Thanks for the suggestions though!