Skip to content

Commit

Permalink
Reformatted
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Fowler committed Feb 22, 2012
1 parent c0545bc commit b7e59f3
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions README.markdown
Expand Up @@ -8,22 +8,18 @@ Installation

If you are running Rails 2.1 or later, installation is straightforward:

<pre><code>
$ ./script/plugin install git://github.com/TheBreeze/shadow.git
</code></pre>


Otherwise, the process is a bit more involved, see below:

<pre><code>
$ cd /path/to/your/rails/app
$ git clone --depth 1 git://github.com/TheBreeze/shadow.git "./vendor/plugins/shadow/"; rm -rf ./vendor/plugins/shadow/.git
</code></pre>


Example
=======

<pre><code>
# After creating your migrations (see TODO)

# In your model
Expand All @@ -34,9 +30,8 @@ Example
# By default, shadows all :attributes and :associations. Here we're attaching a user, so we know who added a photo.
shadow :associations => :photos, :attach => :user
end
</code></pre>

<pre><code>

# In your controller (here we assume nested under VacationController)

class PhotosController < ApplicationController
Expand All @@ -53,24 +48,18 @@ Example
end
end
end
</code></pre>

<pre><code>
# In your view (displaying the updates in the show action of VacationController)

&lt;h1&gt;Vacation Updates&lt;/h1&gt;

&lt;% @vacation.association_updates.each do |update| -%&gt;
&lt;p&gt;&lt;%= update.user.name %&gt; &lt;%= update.action %&gt; &lt;%= update.record.thumbnail %&gt; to &lt;%= update.association %&gt;&lt;/p&gt;
&lt;% end -%&gt;
</code></pre>


<pre><code>
# Example result from view:

&lt;h1&gt;Vacation Updates&lt;/h1&gt;
&lt;p&gt;Jordan added [photo thumbnail] to photos&lt;/p&gt;
</code></pre>

Copyright (c) 2008 Jordan Fowler, released under the MIT license, and originally developed for Cinema Treasures, LLC (http://www.cinematreasures.org/).

0 comments on commit b7e59f3

Please sign in to comment.