<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,5 @@
-&lt;% form_for Rating.new(:rated =&gt; detail, :rating =&gt; 1), 
+&lt;% remote_form_for Rating.new(:rated =&gt; detail, :rating =&gt; 1), 
+    :update =&gt; &quot;rated#{detail.id}&quot;,
     :html =&gt; {:class =&gt; 'remote'} do |f| %&gt;
   &lt;%= f.hidden_field :rated_id %&gt;
   &lt;%= f.hidden_field :rated_type %&gt;
@@ -10,7 +11,8 @@
 &lt;%= detail.ratings.sum(:rating) %&gt;
 &lt;/span&gt;
 
-&lt;% form_for Rating.new(:rated =&gt; detail, :rating =&gt; -1), 
+&lt;% remote_form_for Rating.new(:rated =&gt; detail, :rating =&gt; -1), 
+    :update =&gt; &quot;rated#{detail.id}&quot;,
     :html =&gt; {:class =&gt; 'remote'} do |f| %&gt;
   &lt;%= f.hidden_field :rated_id %&gt;
   &lt;%= f.hidden_field :rated_type %&gt;</diff>
      <filename>app/views/ratings/_voter.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,87 +1,13 @@
 module EasyRatings
   module Controllers
     module RatingsController
-      # GET /ratings
-      # GET /ratings.xml
-      def index
-        @ratings = Rating.find(:all)
-
-        respond_to do |format|
-          format.html # index.html.erb
-          format.xml  { render :xml =&gt; @ratings }
-        end
-      end
-
-      # GET /ratings/1
-      # GET /ratings/1.xml
-      def show
-        @rating = Rating.find(params[:id])
-
-        respond_to do |format|
-          format.html # show.html.erb
-          format.xml  { render :xml =&gt; @rating }
-        end
-      end
-
-      # GET /ratings/new
-      # GET /ratings/new.xml
-      def new
-        @rating = Rating.new
-
-        respond_to do |format|
-          format.html # new.html.erb
-          format.xml  { render :xml =&gt; @rating }
-        end
-      end
-
-      # GET /ratings/1/edit
-      def edit
-        @rating = Rating.find(params[:id])
-      end
-
-      # POST /ratings
-      # POST /ratings.xml
       def create
         @rating = Rating.new(params[:rating])
-
-        respond_to do |format|
-          if @rating.save
-            flash[:notice] = 'Rating was successfully created.'
-            format.html { redirect_to(@rating.rated.room) }
-            format.xml  { render :xml =&gt; @rating, :status =&gt; :created, :location =&gt; @rating }
-          else
-            format.html { render :action =&gt; &quot;new&quot; }
-            format.xml  { render :xml =&gt; @rating.errors, :status =&gt; :unprocessable_entity }
-          end
-        end
-      end
-
-      # PUT /ratings/1
-      # PUT /ratings/1.xml
-      def update
-        @rating = Rating.find(params[:id])
-
-        respond_to do |format|
-          if @rating.update_attributes(params[:rating])
-            flash[:notice] = 'Rating was successfully updated.'
-            format.html { redirect_to(@rating) }
-            format.xml  { head :ok }
-          else
-            format.html { render :action =&gt; &quot;edit&quot; }
-            format.xml  { render :xml =&gt; @rating.errors, :status =&gt; :unprocessable_entity }
-          end
-        end
-      end
-
-      # DELETE /ratings/1
-      # DELETE /ratings/1.xml
-      def destroy
-        @rating = Rating.find(params[:id])
-        @rating.destroy
-
+        @rating.save
         respond_to do |format|
-          format.html { redirect_to(ratings_url) }
-          format.xml  { head :ok }
+          format.js {
+            render :text =&gt; @rating.rated.ratings.sum(:rating)
+          }
         end
       end
     end</diff>
      <filename>vendor/plugins/easy_ratings/lib/easy_ratings/controllers/ratings_controller.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>17f3332032ebcd0231c903f6d5c21730aba6d079</id>
    </parent>
  </parents>
  <author>
    <name>Ben Scofield</name>
    <email>git@turrean.com</email>
  </author>
  <url>http://github.com/bscofield/resourceful-plugin-tutorial-code/commit/2a4884000251d8c064d628c60b70ecdf98c518f6</url>
  <id>2a4884000251d8c064d628c60b70ecdf98c518f6</id>
  <committed-date>2008-09-02T23:35:06-07:00</committed-date>
  <authored-date>2008-09-02T23:35:06-07:00</authored-date>
  <message>AJAXify ratings</message>
  <tree>f681474774d67f250000979c518582cd1d2ac4fe</tree>
  <committer>
    <name>Ben Scofield</name>
    <email>git@turrean.com</email>
  </committer>
</commit>
