title: How to toggle an item's status with JavaScript in Ruby on Rails in index view
body: <p>I have a model in Ruby on Rails (Rails 3) that has a "status" value. The status can either be on or off. In my index view for this model, I show the status for each item (just basic text showing either "on" or "off"). I want users to be able to click on this status field for each item and then it must toggle, without having to re-render the page. So it basically acts like a type of on/off switch.</p>
  
  <p>When I toggle the on/off switch for the specific object, I need to call a controller action to perform some actions. Then I also need to update the view to change "on" to "off" or "off" to "on".</p>
  
  <p>JavaScript would be the way to go, I suppose. I'm not sure if I'll need ajax as well. I have been looking for tutorials with a very basic step-by-step explanation of how to add JavaScript to my Ruby on Rails application. I am a complete newbie to JavaScript in RoR. Most of the tutorials I found assumes a basic background knowledge of JQuery/Protocol/Ajax/Javascript or it goes off on tangents.</p>
  
  <p>Can someone perhaps recommend a good, basic and uncluttered tutorial for getting started with JavaScript in Ruby on Rails and/or give a basic outline as to how the mentioned functionality can be implemented?</p>