<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -12,6 +12,7 @@ h3. Options
 
 --by-user will associate your ratings to a user model.  Hopefully you've got one already.
 
+h4. Without Ajax
 In your model.
 &lt;code&gt;
   &lt;pre&gt;
@@ -42,6 +43,62 @@ Add a method to your books_controller like so:
   &lt;/pre&gt;
 &lt;/code&gt;
 
+h4. Using Ajax
+You can use the same code for your model
+&lt;code&gt;
+  &lt;pre&gt;
+    is_rateable :upto =&gt; 5 # it defaults :upto =&gt; 5
+  &lt;/pre&gt;
+&lt;/code&gt;
+
+On your view, you need to call a partial
+&lt;code&gt;
+  &lt;pre&gt;
+    #Using html.erb
+      &lt;div id=&quot;rating&quot;&gt;
+        &lt;%= render :partial =&gt; &quot;books/rate&quot;, :locals =&gt; { :rateable =&gt; @book } %&gt;
+      &lt;/div&gt;
+
+    #Using haml 
+      #rating
+        render :partial =&gt; &quot;books/rate&quot;, :locals =&gt; { :rateable =&gt; @book }
+  &lt;/pre&gt;
+&lt;/code&gt;
+
+Your partial will have a spinner and a div to be replaced when ajax is completed
+&lt;code&gt;
+  &lt;pre&gt;
+    #Using html.erb (views/books/_rate.html.erb)
+      &lt;%= render_ajax_rating rateable %&gt;
+      &lt;%= image_tag &quot;icons/spinner.gif&quot;, :id =&gt; :spinner, :style =&gt; &quot;display: none;&quot; %&gt;
+      &lt;div id=&quot;success_rating&quot; style=&quot;display:none;&quot;&gt;
+        Rated!
+      &lt;/div&gt;
+
+    #Using haml (views/books/_rate.html.haml)
+
+      = render_ajax_rating rateable
+      = image_tag &quot;icons/spinner.gif&quot;, :id =&gt; :spinner, :style =&gt; &quot;display: none;&quot;
+      #success_rating{:style =&gt; &quot;display:none;&quot;}
+        Rated!
+  &lt;/pre&gt;
+&lt;/code&gt;
+
+On your controller:
+&lt;code&gt;
+  &lt;pre&gt;
+    def rate
+        @book = Book.find(params[:id])
+        @book.rate params[:rating].to_i
+        render :update do |page|
+          page.replace_html(&quot;rating&quot;, {:partial =&gt; &quot;rate&quot;, :locals =&gt; {:rateable =&gt; @book}})
+          page.show &quot;success_rating&quot;
+        end
+    end
+  &lt;/pre&gt;
+&lt;/code&gt;
+
+
 h2. Todo
 
 * Annotate methods
@@ -56,4 +113,8 @@ h2. Credits
 * &quot;Rogie King&quot;:http://komodomedia.com - CSS for Stars
 * Some code from restful_authentication by &quot;Rick Olson&quot;:http://activereload.com
 
+* Ajax Rating
+* &quot;Willian Molinari&quot;:http://pothix.com/blog
+* &quot;Mateus Linhares&quot;:http://github.com/mateuslinhares
+
 *Copyright (c) 2008 Zach Inglis, released under the MIT license*</diff>
      <filename>README.textile</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7c3fe0090cf8522334b3c35eb86a9fcccef150a9</id>
    </parent>
  </parents>
  <author>
    <name>Willian Molinari</name>
    <email>wmolinari@ikwa.com.br</email>
  </author>
  <url>http://github.com/zachinglis/is_rateable/commit/a81f1a0119b39afbe42d432153b07ee5897a3668</url>
  <id>a81f1a0119b39afbe42d432153b07ee5897a3668</id>
  <committed-date>2009-06-09T13:28:33-07:00</committed-date>
  <authored-date>2009-06-09T13:13:15-07:00</authored-date>
  <message>Including instructions and credits

Signed-off-by: Zach Inglis &lt;zach@lt3media.com&gt;</message>
  <tree>0eaaaf237bd551255cfead608cd11f850f081a06</tree>
  <committer>
    <name>Zach Inglis</name>
    <email>zach@lt3media.com</email>
  </committer>
</commit>
