Switching to Jquery from Prototype proved a bit tricky. Good thing I don't have tons and tons of code that had to be converted, huh? Here's a page I found that helped me:
Switching from Prototype to Jquery
Easy enough! This didn't take long to find (third page on a google search, but that's an eternity by today's standards) so I'm hoping it might help others out.
Anyway, back to Chorenivore! Here's the Jquery script Matt showed me that I modified and ended up using:
After I got this script running, I decided I didn't want my flash:notice running across the top of the application. I pulled that code out of application.html.erb, threw it into index.html.erb, slapped a div on it and called it macaroni! Problem solved. It feels AWESOME to mark things off the functionality and features checklist I made for Chorenivore.
Now, how about a couple of questions? You ready?
Here's the code I've got for updating whether a task is finished or not.
<%= form_for(task) do |f| %>
<%= f.hidden_field :finished, :value => !task.finished %>
<% if task.finished %>
<%= image_submit_tag 'finished.png' %>
<% else %>
<%= image_submit_tag 'unfinished.png' %>
<% end %>
Is there a way to pass multiple values to a hidden_field? Right now, I can define a task as finished, but there's no definition for being unfinished. It's just displaying the unfinished button if a task is not marked as finished. I'd like to do this so I can define custom flash :notice messages for when a task is marked as finished from unfinished and vice versa.
I had lunch with Eli today and it's always great to talk to programmers about programming. I find the fact that I've signed up for a never ending stream of headaches, frustrations and triumphs oddly comforting. This is that coding crack I've heard so much about, right?