Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated gh pages again

  • Loading branch information...
commit ab9c053cdff0be5dd75ced343b16255c6ff8b752 1 parent 18b5358
Christian Bäuerlein authored
Showing with 28 additions and 32 deletions.
  1. +24 −31 examples/introduction/index.html
  2. +4 −1 examples/introduction/index.rb
55 examples/introduction/index.html
View
@@ -61,23 +61,16 @@
<li>DRY templates for your api responses</li>
<li>Ships with support for <strong>ActiveRecord</strong> and <strong>Mongoid</strong></li>
<li>Support for Rails 3 Responders</li>
+<li>Plays very well together with client libs like <a href="http://documentcloud.github.com/backbone">Backbone.js</a> or <a href="http://restkit.org">RestKit</a> (iOS).</li>
<li>Easy but very flexible syntax for defining the templates</li>
<li>XML, JSON and JSON-P support out of the box, easy to extend</li>
<li>Support for meta data like pagination info, etc&hellip;</li>
<li>Minimal dependecies (you can also use it without Rails)</li>
<li>Supports multiple api rendering templates for a models. This is especially useful for API versioning or for example for private vs. public access points to a user’s profile.</li>
</ul>
- </td>
- <td class=code>
- <div class='highlight'><pre></pre></div>
- </td>
- </tr>
- <tr id='section-3'>
- <td class=docs>
- <div class="pilwrap">
- <a class="pilcrow" href="#section-3">&#182;</a>
- </div>
- <hr />
+
+
+<hr />
</td>
<td class=code>
<div class='highlight'><pre></pre></div>
@@ -94,10 +87,10 @@
<div class='highlight'><pre></pre></div>
</td>
</tr>
- <tr id='section-5'>
+ <tr id='section-4'>
<td class=docs>
<div class="pilwrap">
- <a class="pilcrow" href="#section-5">&#182;</a>
+ <a class="pilcrow" href="#section-4">&#182;</a>
</div>
<p>Add to gemfile</p>
</td>
@@ -105,10 +98,10 @@
<div class='highlight'><pre><span class="n">gem</span> <span class="s1">&#39;acts_as_api&#39;</span></pre></div>
</td>
</tr>
- <tr id='section-6'>
+ <tr id='section-5'>
<td class=docs>
<div class="pilwrap">
- <a class="pilcrow" href="#section-6">&#182;</a>
+ <a class="pilcrow" href="#section-5">&#182;</a>
</div>
<p>Update your bundle</p>
</td>
@@ -127,10 +120,10 @@
<div class='highlight'><pre></pre></div>
</td>
</tr>
- <tr id='section-8'>
+ <tr id='section-7'>
<td class=docs>
<div class="pilwrap">
- <a class="pilcrow" href="#section-8">&#182;</a>
+ <a class="pilcrow" href="#section-7">&#182;</a>
</div>
<p>Given you have a model <code>User</code>.
If you only want to expose the <code>first_name</code> and <code>last_name</code> attribute of a user via your api, you would do something like this:</p>
@@ -139,10 +132,10 @@
<div class='highlight'><pre></pre></div>
</td>
</tr>
- <tr id='section-9'>
+ <tr id='section-8'>
<td class=docs>
<div class="pilwrap">
- <a class="pilcrow" href="#section-9">&#182;</a>
+ <a class="pilcrow" href="#section-8">&#182;</a>
</div>
<p>Within your model:</p>
@@ -163,10 +156,10 @@
<span class="k">end</span></pre></div>
</td>
</tr>
- <tr id='section-10'>
+ <tr id='section-9'>
<td class=docs>
<div class="pilwrap">
- <a class="pilcrow" href="#section-10">&#182;</a>
+ <a class="pilcrow" href="#section-9">&#182;</a>
</div>
<p>An API template with the name <code>:name_only</code> was created.</p>
@@ -187,10 +180,10 @@
<div class='highlight'><pre></pre></div>
</td>
</tr>
- <tr id='section-12'>
+ <tr id='section-11'>
<td class=docs>
<div class="pilwrap">
- <a class="pilcrow" href="#section-12">&#182;</a>
+ <a class="pilcrow" href="#section-11">&#182;</a>
</div>
<p>Now you just have to exchange the <code>render</code> method in your controller for the <code>render_for_api</code> method.</p>
</td>
@@ -201,10 +194,10 @@
<span class="vi">@users</span> <span class="o">=</span> <span class="no">User</span><span class="o">.</span><span class="n">all</span></pre></div>
</td>
</tr>
- <tr id='section-13'>
+ <tr id='section-12'>
<td class=docs>
<div class="pilwrap">
- <a class="pilcrow" href="#section-13">&#182;</a>
+ <a class="pilcrow" href="#section-12">&#182;</a>
</div>
<p>Note that it&rsquo;s wise to add a <code>root</code> param when rendering lists.</p>
</td>
@@ -238,10 +231,10 @@
<div class='highlight'><pre></pre></div>
</td>
</tr>
- <tr id='section-15'>
+ <tr id='section-14'>
<td class=docs>
<div class="pilwrap">
- <a class="pilcrow" href="#section-15">&#182;</a>
+ <a class="pilcrow" href="#section-14">&#182;</a>
</div>
<p>Try it. The JSON response of #show should now look like this:</p>
@@ -257,10 +250,10 @@
<span class="p">}</span></pre></div>
</td>
</tr>
- <tr id='section-16'>
+ <tr id='section-15'>
<td class=docs>
<div class="pilwrap">
- <a class="pilcrow" href="#section-16">&#182;</a>
+ <a class="pilcrow" href="#section-15">&#182;</a>
</div>
<hr />
</td>
@@ -308,10 +301,10 @@
<div class='highlight'><pre></pre></div>
</td>
</tr>
- <tr id='section-19'>
+ <tr id='section-18'>
<td class=docs>
<div class="pilwrap">
- <a class="pilcrow" href="#section-19">&#182;</a>
+ <a class="pilcrow" href="#section-18">&#182;</a>
</div>
<hr />
</td>
5 examples/introduction/index.rb
View
@@ -7,14 +7,17 @@
# * DRY templates for your api responses
# * Ships with support for **ActiveRecord** and **Mongoid**
# * Support for Rails 3 Responders
+# * Plays very well together with client libs like [Backbone.js][b1] or [RestKit][r1] (iOS).
# * Easy but very flexible syntax for defining the templates
# * XML, JSON and JSON-P support out of the box, easy to extend
# * Support for meta data like pagination info, etc...
# * Minimal dependecies (you can also use it without Rails)
# * Supports multiple api rendering templates for a models. This is especially useful for API versioning or for example for private vs. public access points to a user’s profile.
-
+# [b1]: http://documentcloud.github.com/backbone
+# [r1]: http://restkit.org
# ***
+
### Rails 3.x Quickstart
# Add to gemfile
Please sign in to comment.
Something went wrong with that request. Please try again.