<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>spotstory &#187; plugin</title>
	<atom:link href="http://blog.spotstory.com/category/plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.spotstory.com</link>
	<description></description>
	<lastBuildDate>Tue, 11 Mar 2008 21:13:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Automatic Markup Validation</title>
		<link>http://blog.spotstory.com/2007/04/09/automatic-markup-validation/</link>
		<comments>http://blog.spotstory.com/2007/04/09/automatic-markup-validation/#comments</comments>
		<pubDate>Mon, 09 Apr 2007 18:02:21 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.spotstory.com/2007/04/09/automatic-markup-validation/</guid>
		<description><![CDATA[It is quite easy to extend your Ruby on Rails test infrastructure so every document is checked for validity.

Install the plugin assert_valid_markup.
Install my test_validation_helper.rb in your test directory.
Require the validation helper from your test/test_helper.rb:

require File.expand_path(File.dirname(__FILE__) +
    "/test/test_validation_helper.rb")


After those three simple steps, your HTML and RSS documents are now being validated each time [...]]]></description>
			<content:encoded><![CDATA[<p>It is quite easy to extend your Ruby on Rails test infrastructure so every document is checked for validity.</p>
<ol>
<li>Install the plugin <a href="http://redgreenblu.com/svn/projects/assert_valid_markup/"><tt>assert_valid_markup</tt></a>.</li>
<li>Install my <a id="p131" href="http://blog.spotstory.com/wp-content/uploads/2007/04/test_validation_helperrb.zip" title="test_validation_helper.rb"><tt>test_validation_helper.rb</tt></a> in your test directory.</li>
<li>Require the validation helper from your test/test_helper.rb:
<pre>
require File.expand_path(File.dirname(__FILE__) +
    "/test/test_validation_helper.rb")</pre>
</li>
</ol>
<p>After those three simple steps, your HTML and RSS documents are now being validated each time you run tests.</p>
<p>I am giving a brief presentation on this topic at the <a href="http://boston.rubygroup.org/articles/2007/04/04/april-meeting">April 10, 2007</a> <a href="http://boston.rubygroup.org/">Boston Ruby Group</a> meeting.</p>
<p>You can flip through a <a href="http://blog.spotstory.com/wp-content/uploads/2007/04/automatic-markup-validation.pdf" title="Automatic Markup Validation">PDF of my slides</a> if you would like more details.</p>
<p><strong>Update:</strong> In addition to the <a href="http://blog.spotstory.com/wp-content/uploads/2007/04/automatic-markup-validation.pdf" title="Automatic Markup Validation">PDF</a>, my presentation is now hosted on slideshare and shown below. If you are reading this post in an aggregrator, you will need to <a href="http://www.slideshare.net/aron/automatic-markup-validation/">click through for the show</a> (or just use the PDF version).</p>
<p><object type="application/x-shockwave-flash" data="https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=36946&#038;doc=automatic-markup-validation-14304" width="425" height="348"><param name="movie" value="https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=36946&#038;doc=automatic-markup-validation-14304" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.spotstory.com/2007/04/09/automatic-markup-validation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>acts_as_favorite</title>
		<link>http://blog.spotstory.com/2006/12/26/acts_as_favorite/</link>
		<comments>http://blog.spotstory.com/2006/12/26/acts_as_favorite/#comments</comments>
		<pubDate>Tue, 26 Dec 2006 16:26:35 +0000</pubDate>
		<dc:creator>Aron</dc:creator>
				<category><![CDATA[plugin]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.spotstory.com/2006/12/26/acts_as_favorite/</guid>
		<description><![CDATA[We are using Josh Martin&#8217;s acts_as_favorite plugin (also here).
I have made a few acts_as_favorite bug fixes (contextual diff file). These properly set the user_id in your favorites table and update the favorites associations as you add/delete favorites.
Here is how we tell the user class that it will have favorites:

class User < ActiveRecord::Base
  acts_as_favorite_user
end

Here is [...]]]></description>
			<content:encoded><![CDATA[<p>We are using Josh Martin&#8217;s <a href="http://www.agilewebdevelopment.com/plugins/acts_as_favorite">acts_as_favorite</a> plugin (also <a href="http://www.rubyonrailsblog.com/articles/2006/10/20/rails-plugin-acts_as_favorite-released-track-users-favorites">here</a>).</p>
<p>I have made a few <a href="http://blog.spotstory.com/wp-content/uploads/2006/12/acts_as_favorite.txt">acts_as_favorite bug fixes</a> (contextual diff file). These properly set the user_id in your favorites table and update the favorites associations as you add/delete favorites.</p>
<p>Here is how we tell the user class that it will have favorites:</p>
<pre>
class User < ActiveRecord::Base
  acts_as_favorite_user
end
</pre>
<p>Here is how we tell a different model that it can be marked as a favorite:</p>
<pre>
class Thing < ActiveRecord::Base
  acts_as_favorite
end
</pre>
<p>In our controller, we allow a user to mark a favorite thing. There is code elsewhere which makes sure that the user is logged in.</p>
<pre>
class ThingController < ApplicationController
  def add_favorite
    @thing = Thing.find(params[:id])
    @user = User.find(session[:user_id])
    @user.has_favorite(@thing)
    redirect_to :action => 'show', :id => @thing
  end

  def remove_favorite
    @thing = Thing.find(params[:id])
    @user = User.find(session[:user_id])
    @user.has_no_favorite(@thing)
    redirect_to :action => 'show', :id => @thing
  end
end
</pre>
<p>That's all there is to it. You now have users who can mark objects as favorites.</p>
<p><b>Update:</b> It appears that the official repository for acts_as_favorite is not reliable. I have archived my snapshot of <a href="/media/acts_as_favorite.tar.gz">acts_as_favorite</a>. This version includes the patch listed above.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.spotstory.com/2006/12/26/acts_as_favorite/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
