<?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>Simply Excited - Technology, Outdoor and Design &#187; Plugins</title>
	<atom:link href="http://scoop.simplyexcited.co.uk/category/plugins/feed/" rel="self" type="application/rss+xml" />
	<link>http://scoop.simplyexcited.co.uk</link>
	<description>Technology, Design and Outdoor</description>
	<lastBuildDate>Fri, 23 Dec 2011 11:33:22 +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>Wee Beastie Rails Forum Engine</title>
		<link>http://scoop.simplyexcited.co.uk/2009/08/21/wee-beastie-rails-forum-engine/</link>
		<comments>http://scoop.simplyexcited.co.uk/2009/08/21/wee-beastie-rails-forum-engine/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 20:59:51 +0000</pubDate>
		<dc:creator>pyrat</dc:creator>
				<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://scoop.cheerfactory.co.uk/2009/08/21/wee-beastie-rails-forum-engine/</guid>
		<description><![CDATA[	

	I have modified Savage-Beast extensively to make it run as a rails engine under rails 2.3.x. I think that rails engines are suited to running forum systems. The modifications that I made seemed a bit aggressive (I removed internationalization) so decided a separate project was required.

	I have named it Wee Beastie

	Currently the install process is [...]]]></description>
			<content:encoded><![CDATA[	<p><img src="http://farm3.static.flickr.com/2492/3836426712_79c9abc1e5.jpg" alt="" border="0" /></p>

	<p>I have modified <a href="git://github.com/wbharding/savage-beast.git" title="">Savage-Beast</a> extensively to make it run as a rails engine under rails 2.3.x. I think that rails engines are suited to running forum systems. The modifications that I made seemed a bit aggressive (I removed internationalization) so decided a separate project was required.</p>

	<p>I have named it <a href="http://github.com/pyrat/wee_beastie/tree/master" title="">Wee Beastie</a></p>

	<p>Currently the install process is a bit long winded which I hope to tidy up soon, if you want to help feel free to fork and get involved.</p>

	<h2>Wee Beastie</h2>

	<p>Rewrite of SavageBeast to work with Rails 2.3.x as a rails engine.</p>

	<h2>Install</h2>

	<ul>
		<li>script/plugin install git://github.com/pyrat/wee_beastie.git</li>
		<li>rake wee_beastie:sync_migrations</li>
		<li>rake wee_beastie:sync_public</li>
		<li>rake wee_beastie:install_plugins</li>
		<li>rake db:migrate</li>
		<li>config.cache_classes = true (environment.rb) &#8211; means restarts, sorry!</li>
		<li>config.active_record.default_timezone = :utc</li>
		<li>include WeeBeastie::UserInit to user model</li>
		<li>setup a user to have forum_admin attribute set to true to allow you to administer and setup the forums.</li>
	</ul>

	<h2><span class="caps">TODO</span></h2>

	<ul>
		<li>Currently there is no out of the box way to create moderatorships. You need to add the create moderatorship links in your you administration.</li>
	</ul>
 ]]></content:encoded>
			<wfw:commentRss>http://scoop.simplyexcited.co.uk/2009/08/21/wee-beastie-rails-forum-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wee_lightbox rails plugin</title>
		<link>http://scoop.simplyexcited.co.uk/2008/08/06/wee_lightbox-rails-plugin/</link>
		<comments>http://scoop.simplyexcited.co.uk/2008/08/06/wee_lightbox-rails-plugin/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 21:46:24 +0000</pubDate>
		<dc:creator>pyrat</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://scoop.cheerfactory.co.uk/2008/08/06/wee_lightbox-rails-plugin/</guid>
		<description><![CDATA[	

	Overview

	This is a packaged version of lightbox for viewing images on the screen in the popular lightbox design pattern. The plugin includes some view helpers and an automatic install script to make life easier.

	Please refer to the lightbox docs for more info. Included are some rails helpers for easy integration into your site. The lightbox [...]]]></description>
			<content:encoded><![CDATA[	<p><img src="http://farm3.static.flickr.com/2361/2738991929_fd280a5514_o.jpg" alt="" border="0" /></p>

	<h2>Overview</h2>

	<p>This is a packaged version of lightbox for viewing images on the screen in the popular lightbox design pattern. The plugin includes some view helpers and an automatic install script to make life easier.</p>

	<p>Please refer to the lightbox docs for more info. Included are some rails helpers for easy integration into your site. The lightbox javascript is slightly tweaked to configure the location of images and increase the speed of resize.</p>

	<p>You can edit lightbox.js to further tweak these if you wish.</p>

	<h2>Install</h2>


	<p>If you install from github with rails 2.1+ it will install the files into your public directory. If you install with another method, you may need to issue a recursive copy command manually.</p>

	<p>Also this install script is untested on windows.</p>

	<h2>Usage Example</h2>

	<p>In your layout add the following in the head section.</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">&lt;%= javascript_include_tag :defaults %&gt; 
&lt;%= yield :page_includes %&gt;</pre></div></div>
</p>



	<p>In your template:</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">&lt;%= load_lightbox %&gt;</pre></div></div>
</p>



	<p>For each image that you would like to make a lightbox to</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">&lt;%= lightbox_to<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'/images/small.gif'</span>, <span style="color: #ff0000;">'/images/large.gif'</span>, <span style="color: #ff0000;">&quot;Tasty image caption&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>
</p>



	<p>If you want to have more than one lightbox on a page and have the lightbox operate with a slideshow between images..</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">&lt;%= lightbox_to<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'/images/small.gif'</span>, <span style="color: #ff0000;">'/images/large.gif'</span>, <span style="color: #ff0000;">&quot;Tasty image caption&quot;</span>, <span style="color: #ff0000;">&quot;group_name&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>
</p>



	<p>Where group name needs to be the same for all images in the slideshow.</p>

	<p><a href="http://github.com/pyrat/wee_lightbox/tree/master" title="">Github project page</a></p>
 ]]></content:encoded>
			<wfw:commentRss>http://scoop.simplyexcited.co.uk/2008/08/06/wee_lightbox-rails-plugin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Wee Date Picker Rails Plugin</title>
		<link>http://scoop.simplyexcited.co.uk/2008/07/18/wee-date-picker-rails-plugin/</link>
		<comments>http://scoop.simplyexcited.co.uk/2008/07/18/wee-date-picker-rails-plugin/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 08:04:16 +0000</pubDate>
		<dc:creator>pyrat</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://scoop.cheerfactory.co.uk/2008/07/18/wee-date-picker-rails-plugin/</guid>
		<description><![CDATA[	

	After a bit of a sabbatical here is another plugin for you to feast on.

	This is a super simple datepicker for your rails apps. It is essentially just a packaged version of DatePicker v2.9 by frequency-decoder.com with rails helpers for easy integration.


	Install

	If you install the plugin using git the installer should run and the files [...]]]></description>
			<content:encoded><![CDATA[	<p><img src="http://farm4.static.flickr.com/3048/2679550392_01a3392ba0_o.jpg" alt="" border="0" /></p>

	<p>After a bit of a sabbatical here is another plugin for you to feast on.</p>

	<p>This is a super simple datepicker for your rails apps. It is essentially just a packaged version of DatePicker v2.9 by frequency-decoder.com with rails helpers for easy integration.</p>


	<h3>Install</h3>

	<p>If you install the plugin using git the installer should run and the files will be copied across recursively to your public directory.</p>

	<h3>Example</h3>

	<p>In the <strong>head</strong> section of the layout.</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">&lt;%= yield :date_includes %&gt;</pre></div></div>
</p>



	<p>In the template.</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">&lt;%= load_date_picker %&gt;</pre></div></div>
</p>


	<p>Then for each date field you need to do the following. <strong>Remember</strong>: field_names have to be unique on your page.</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">&lt;%= date_picker :start_date, Date.today %&gt;</pre></div></div>
</p>


	<p>Where the first argument is the field_name and the second is the initial value. This must be a date object.</p>

	<p>This is a tiny plugin which needs a bit of work but hopefully it helps. It is available on the <a href="http://github.com/pyrat/wee_date_picker/tree/master" title="">github project page</a></p>

	<p><strong>Update</strong>: I wrote the installer script myself.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://scoop.simplyexcited.co.uk/2008/07/18/wee-date-picker-rails-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FAQ_U Rails FAQ Generator Plugin</title>
		<link>http://scoop.simplyexcited.co.uk/2007/12/20/faq_u-rails-faq-generator-plugin/</link>
		<comments>http://scoop.simplyexcited.co.uk/2007/12/20/faq_u-rails-faq-generator-plugin/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 11:25:27 +0000</pubDate>
		<dc:creator>pyrat</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://scoop.cheerfactory.co.uk/2007/12/20/faq_u-rails-faq-generator-plugin/</guid>
		<description><![CDATA[	

	For a christmas present I give you the Rails FAQ Generator plugin FAQ_U.

	This is a simple layout-less unbranded Frequently Asked Questions system. The idea is you generate the default system and then customise it to the requirements of the particular project that you are working on.

	Remember to add some authentication to the faq_admin controller.

	Requires HAML. [...]]]></description>
			<content:encoded><![CDATA[	<p><img src="http://scoop.simplyexcited.co.uk/wp-content/uploads/2007/12/faq_u.gif" alt="Faq u" border="0" /></p>

	<p>For a christmas present I give you the Rails <span class="caps">FAQ </span>Generator plugin <span class="caps">FAQ</span>_U.</p>

	<p>This is a simple layout-less unbranded Frequently Asked Questions system. The idea is you generate the default system and then customise it to the requirements of the particular project that you are working on.</p>

	<p>Remember to add some authentication to the faq_admin controller.</p>

	<p>Requires <a href="http://haml.hamptoncatlin.com/download/" title=""><span class="caps">HAML</span></a>. To install it:</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">gem <span style="color: #c20cb9; font-weight: bold;">install</span> --no-ri haml
haml --rails path/to/app</pre></div></div>
</p>



	<p>To install the plugin:</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">./script/plugin <span style="color: #c20cb9; font-weight: bold;">install</span> http://vorlich.ath.cx/code/excited/plugins/faq_u</pre></div></div>
</p>



	<p>To run the generator:</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">./script/generate faq</pre></div></div>
</p>



	<p>This generates a <span class="caps">FAQ</span> admin controller, <span class="caps">FAQ</span> view controller, the necessary views, a model, db migration and a collection of<br />
tests.</p>

	<p>After the generator is complete run the migration to get the database up to scratch.</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">rake db:migrate</pre></div></div>
</p>



	<p>The faq admin is available at */faq_admin* and the front end at */faq*. As you can see below it looks pretty filthy, but as you can see below that, with the introduction of a layout it looks nicer.</p>

	<p><img src="http://scoop.simplyexcited.co.uk/wp-content/uploads/2007/12/unstyled.png" alt="unstyled" border="0" /></p>

	<p><a href="http://www.racentries.com"><img src="http://scoop.simplyexcited.co.uk/wp-content/uploads/2007/12/styled.png" alt="styled" border="0" /></a></p>

	<p>A would be nice would be a nice <span class="caps">AJAX</span> ordering interface in the faq_admin. Feel free to send me some svn patches of any improvements you make. Please write some tests to prove the new functionality works. Cheers now, Merry Christmas.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://scoop.simplyexcited.co.uk/2007/12/20/faq_u-rails-faq-generator-plugin/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Rupdf &#8211; Simple Ruby PDF Rails Plugin</title>
		<link>http://scoop.simplyexcited.co.uk/2007/12/15/rupdf-simple-ruby-pdf-rails-plugin/</link>
		<comments>http://scoop.simplyexcited.co.uk/2007/12/15/rupdf-simple-ruby-pdf-rails-plugin/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 12:37:07 +0000</pubDate>
		<dc:creator>pyrat</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://scoop.cheerfactory.co.uk/2007/12/15/rupdf-simple-ruby-pdf-rails-plugin/</guid>
		<description><![CDATA[	

	This is a plugin which I have developed internally with Iformis. I realised it would be nice to share yet another pdf plugin with the rails community. This is designed to render pdfs with layouts. This is especially useful when working on projects where the pdf has to conform to a set design and where [...]]]></description>
			<content:encoded><![CDATA[	<p><img src="http://scoop.simplyexcited.co.uk/wp-content/uploads/2007/11/rupdf.jpg" alt="Rupdf" border="0" /></p>

	<p>This is a plugin which I have developed internally with <a href="http://www.iformis.com" title="">Iformis</a>. I realised it would be nice to share yet another pdf plugin with the rails community. This is designed to render pdfs with layouts. This is especially useful when working on projects where the pdf has to conform to a set design and where the data is presented in a generate report style. Banks often operate their tools in this manner.</p>

	<p>Simple <span class="caps">PDF</span> reporting rails plugin designed to render layout based pdfs. Built on top of Ruport which is in turn built on top of pdf-writer.</p>

	<p>Requires Ruport</p>

	<p>Step 1: Install Ruport</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">gem <span style="color: #c20cb9; font-weight: bold;">install</span> ruport</pre></div></div>
</p>



	<p>Step 2: Install the plugin (from <span class="caps">RAILS</span>_ROOT)</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">./script/plugin <span style="color: #c20cb9; font-weight: bold;">install</span> http://iformis.svnrepository.com/svn/rupdf</pre></div></div>
</p>



	<p>Step 3: Create a class extending Rupdf::Base</p>

	<p>Note: The only methods calls required are define_header, define_body and define_footer<br />
The other methods are helper methods. Remember that html doesnt work in the body.</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#9966CC; font-weight:bold;">class</span> Simple &lt; <span style="color:#6666ff; font-weight:bold;">Rupdf::Base</span>
&nbsp;
  define_variables <span style="color:#ff3333; font-weight:bold;">:report_title</span>
  renders <span style="color:#ff3333; font-weight:bold;">:pdf</span>, <span style="color:#ff3333; font-weight:bold;">:for</span> =&gt; <span style="color:#6666ff; font-weight:bold;">Rupdf::Renderer</span>
&nbsp;
  define_header <span style="color:#9966CC; font-weight:bold;">do</span>
    add_header<span style="color:#006600; font-weight:bold;">&#40;</span>report_title<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  define_body <span style="color:#9966CC; font-weight:bold;">do</span>
    add_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;hello man<span style="color:#000099;">\n</span><span style="color:#000099;">\n</span><span style="color:#000099;">\n</span>&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    add_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;bye man.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    add_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;bye man.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    add_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;hello man<span style="color:#000099;">\n</span><span style="color:#000099;">\n</span><span style="color:#000099;">\n</span>&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    add_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;bye man.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    add_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;hello man<span style="color:#000099;">\n</span><span style="color:#000099;">\n</span><span style="color:#000099;">\n</span>&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    add_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;bye man.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># add image (path defined at runtime)</span>
    image<span style="color:#006600; font-weight:bold;">&#40;</span>smile_path<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    add_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;hello man<span style="color:#000099;">\n</span><span style="color:#000099;">\n</span><span style="color:#000099;">\n</span>&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    add_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;bye man.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    add_text<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;hello man<span style="color:#000099;">\n</span><span style="color:#000099;">\n</span><span style="color:#000099;">\n</span>&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  define_footer <span style="color:#9966CC; font-weight:bold;">do</span>
    footer_text = %<span style="color:#006600; font-weight:bold;">&#40;</span>
    This is the beautiful footer text.
    <span style="color:#006600; font-weight:bold;">&#41;</span>
    add_footer<span style="color:#006600; font-weight:bold;">&#40;</span>footer_text<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> add_header<span style="color:#006600; font-weight:bold;">&#40;</span>title<span style="color:#006600; font-weight:bold;">&#41;</span>
    rounded_text_box<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;&lt;b&gt;#{title}&lt;/b&gt;&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> |o|
      header_color = <span style="color:#6666ff; font-weight:bold;">Color::RGB</span>.<span style="color:#9900CC;">from_html</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#FFDE16&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      o.<span style="color:#9900CC;">fill_color</span> = header_color
      o.<span style="color:#9900CC;">stroke_color</span> = header_color
      o.<span style="color:#9900CC;">radius</span>     = <span style="color:#006666;">0</span>
      o.<span style="color:#9900CC;">width</span>      = options.<span style="color:#9900CC;">header_width</span> || <span style="color:#006666;">550</span>
      o.<span style="color:#9900CC;">height</span>     = options.<span style="color:#9900CC;">header_height</span> || <span style="color:#006666;">80</span>
      o.<span style="color:#9900CC;">font_size</span>  = options.<span style="color:#9900CC;">header_font_size</span> || <span style="color:#006666;">12</span>
      o.<span style="color:#9900CC;">x</span>          = pdf_writer.<span style="color:#9900CC;">absolute_right_margin</span> - o.<span style="color:#9900CC;">width</span>
      o.<span style="color:#9900CC;">y</span>          = pdf_writer.<span style="color:#9900CC;">absolute_top_margin</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> add_footer<span style="color:#006600; font-weight:bold;">&#40;</span>text, options = <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">unless</span> options
      options = OpenStruct.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:font_size</span> =&gt; <span style="color:#006666;">6</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    rounded_text_box<span style="color:#006600; font-weight:bold;">&#40;</span>text<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> |o|
      footer_color = <span style="color:#6666ff; font-weight:bold;">Color::RGB</span>.<span style="color:#9900CC;">from_html</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#EAECEE&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      o.<span style="color:#9900CC;">fill_color</span> = footer_color
      o.<span style="color:#9900CC;">stroke_color</span> = footer_color
      o.<span style="color:#9900CC;">radius</span>     = <span style="color:#006666;">0</span>
      o.<span style="color:#9900CC;">width</span>      = options.<span style="color:#9900CC;">header_width</span> || <span style="color:#006666;">550</span>
      o.<span style="color:#9900CC;">height</span>     = options.<span style="color:#9900CC;">header_height</span> || <span style="color:#006666;">60</span>
      o.<span style="color:#9900CC;">font_size</span>  = options.<span style="color:#9900CC;">font_size</span> || <span style="color:#006666;">12</span>
      o.<span style="color:#9900CC;">x</span>          = pdf_writer.<span style="color:#9900CC;">absolute_right_margin</span> - o.<span style="color:#9900CC;">width</span>
      o.<span style="color:#9900CC;">y</span>          = pdf_writer.<span style="color:#9900CC;">absolute_bottom_margin</span> + o.<span style="color:#9900CC;">height</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>




	<p>Step 4: Tie it into a controller and pass the variables at runtime.</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#9966CC; font-weight:bold;">class</span> TestController &lt; ApplicationController
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> pdf
    simple = Simple.<span style="color:#9900CC;">new</span>
    pdf = <span style="color:#6666ff; font-weight:bold;">Rupdf::Renderer</span>.<span style="color:#9900CC;">render_pdf</span> <span style="color:#9966CC; font-weight:bold;">do</span> |o|
      o.<span style="color:#9900CC;">report_title</span> = <span style="color:#996600;">'This is a test of a var being passed.'</span>
      o.<span style="color:#9900CC;">smile_path</span> = RAILS_ROOT + <span style="color:#996600;">'/public/images/smile.jpg'</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
    send_pdf<span style="color:#006600; font-weight:bold;">&#40;</span>pdf<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>



	<p>The send_pdf function sends the rendered pdf to the browser.</p>

	<p>If you need to perform more complicated pdf rendering operation<br />
please refer to the <span class="caps">API </span>Documentation for pdf-writer. The <span class="caps">API</span> docs for<br />
ruport will also be useful if you are involved in presenting tabular<br />
data from activerecord.</p>

	<p>Example programming code along with how to call it is supplied in the<br />
examples directory. I suggest you use these as a base for pdf generation code you write.</p>

	<p>This has been tested with both Rails 1.2 and Rails 2.01. Thanks for listening.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://scoop.simplyexcited.co.uk/2007/12/15/rupdf-simple-ruby-pdf-rails-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Attachment Fu Validates As Attachment Hack</title>
		<link>http://scoop.simplyexcited.co.uk/2007/11/28/attachment-fu-validates-as-attachment-hack/</link>
		<comments>http://scoop.simplyexcited.co.uk/2007/11/28/attachment-fu-validates-as-attachment-hack/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 17:28:55 +0000</pubDate>
		<dc:creator>pyrat</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://scoop.cheerfactory.co.uk/2007/11/28/attachment-fu-validates-as-attachment-hack/</guid>
		<description><![CDATA[	

	Recent err the blog posted about the my evil twin hack technique

	In this post they detail how to hack plugins nicely and provide an example on how to hack attachment_fu. It turns out that I have been spending quite a bit of time with attachment_fu on various projects recently and have started to need it [...]]]></description>
			<content:encoded><![CDATA[	<p><img src="http://scoop.simplyexcited.co.uk/wp-content/uploads/2007/11/attachment_fu_hack.gif" alt="Attachment Fu Hack" border="0" /></p>

	<p>Recent err the blog posted about the <a href="http://errtheblog.com/post/19679" title="">my evil twin hack technique</a></p>

	<p>In this post they detail how to hack plugins nicely and provide an example on how to hack attachment_fu. It turns out that I have been spending quite a bit of time with attachment_fu on various projects recently and have started to need it to do slightly different things.</p>

	<p>Below is a hack I have written to improve validates_as_attachment. Using the evil twin technique this will just ask for a file to be uploaded if you dont upload anything. Instead of spewing out a whole load of errors that dont help the user much.</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby">klass = <span style="color:#6666ff; font-weight:bold;">Technoweenie::AttachmentFu::ClassMethods</span>
klass.<span style="color:#9900CC;">module_eval</span> <span style="color:#9966CC; font-weight:bold;">do</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> validates_as_attachment
validate <span style="color:#ff3333; font-weight:bold;">:uploaded_data_is_present</span>
validates_presence_of <span style="color:#ff3333; font-weight:bold;">:size</span>, <span style="color:#ff3333; font-weight:bold;">:content_type</span>, <span style="color:#ff3333; font-weight:bold;">:filename</span>, <span style="color:#ff3333; font-weight:bold;">:if</span> =&gt; <span style="color:#ff3333; font-weight:bold;">:uploaded_data</span>?
validate              <span style="color:#ff3333; font-weight:bold;">:attachment_attributes_valid</span>?
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
klazz = <span style="color:#6666ff; font-weight:bold;">Technoweenie::AttachmentFu::InstanceMethods</span>
klazz.<span style="color:#9900CC;">module_eval</span> <span style="color:#9966CC; font-weight:bold;">do</span>
<span style="color:#9966CC; font-weight:bold;">def</span> uploaded_data?
  <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span> <span style="color:#9966CC; font-weight:bold;">unless</span> filename
  <span style="color:#0000FF; font-weight:bold;">true</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># validates the size and content_type attributes according to the current model's options</span>
<span style="color:#9966CC; font-weight:bold;">def</span> attachment_attributes_valid?
<span style="color:#9966CC; font-weight:bold;">if</span> uploaded_data?
<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:size</span>, <span style="color:#ff3333; font-weight:bold;">:content_type</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> |attr_name|
enum = attachment_options<span style="color:#006600; font-weight:bold;">&#91;</span>attr_name<span style="color:#006600; font-weight:bold;">&#93;</span>
errors.<span style="color:#9900CC;">add</span> attr_name, <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Errors</span>.<span style="color:#9900CC;">default_error_messages</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:inclusion</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> enum.<span style="color:#0000FF; font-weight:bold;">nil</span>? || enum.<span style="color:#9966CC; font-weight:bold;">include</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>send<span style="color:#006600; font-weight:bold;">&#40;</span>attr_name<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> uploaded_data_is_present
<span style="color:#9966CC; font-weight:bold;">unless</span> uploaded_data?
errors.<span style="color:#9900CC;">add_to_base</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;You must select a file to upload.&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>


	<p>This serves as a drop in replacement for <strong>validates_as_attachment</strong></p>
 ]]></content:encoded>
			<wfw:commentRss>http://scoop.simplyexcited.co.uk/2007/11/28/attachment-fu-validates-as-attachment-hack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Checkbox Select Rails Plugin</title>
		<link>http://scoop.simplyexcited.co.uk/2007/11/05/checkbox-select-rails-plugin/</link>
		<comments>http://scoop.simplyexcited.co.uk/2007/11/05/checkbox-select-rails-plugin/#comments</comments>
		<pubDate>Mon, 05 Nov 2007 12:41:41 +0000</pubDate>
		<dc:creator>pyrat</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://scoop.cheerfactory.co.uk/2007/11/05/checkbox-select-rails-plugin/</guid>
		<description><![CDATA[	

	I had the problem of there not being a simple form rendering solution for has_and_belongs_to_many ActiveRecord relations. I found a partial solution here: http://railshacks.blogspot.com/2007/09/helper-checkboxcollection.html

	I have modified the original code slightly, and extracted it to a plugin. To install it:

	
  ./script/plugin install http://vorlich.ath.cx/code/excited/plugins/checkbox_select





	In your model you are manipulating in the form:

	
  class Advertisement &#60; [...]]]></description>
			<content:encoded><![CDATA[	<p><img src="http://scoop.simplyexcited.co.uk/wp-content/uploads/2007/11/checkbox.jpg" alt="checkbox" border="0" /></p>

	<p>I had the problem of there not being a simple form rendering solution for has_and_belongs_to_many ActiveRecord relations. I found a partial solution here: <a href="http://railshacks.blogspot.com/2007/09/helper-checkboxcollection.html" title="">http://railshacks.blogspot.com/2007/09/helper-checkboxcollection.html</a></p>

	<p>I have modified the original code slightly, and extracted it to a plugin. To install it:</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="bash">  ./script/plugin <span style="color: #c20cb9; font-weight: bold;">install</span> http://vorlich.ath.cx/code/excited/plugins/checkbox_select</pre></div></div>
</p>




	<p>In your model you are manipulating in the form:</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby">  <span style="color:#9966CC; font-weight:bold;">class</span> Advertisement &lt; <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">include</span> CheckboxSelectable
    has_and_belongs_to_many <span style="color:#ff3333; font-weight:bold;">:categories</span>
    validates_presence_of <span style="color:#ff3333; font-weight:bold;">:name</span>
    validates_uniqueness_of <span style="color:#ff3333; font-weight:bold;">:name</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>



	<p>The include is the important bit.</p>

	<p>In your view:</p>

	<p>
<div class="wp_syntax"><div class="code"><pre>  &lt;%= checkbox_select('advertisement', 'categories', @categories, 'name') %&gt;</pre></div></div>
</p>




	<p>In your controller add the <strong>update_check_list</strong> method:</p>

	<p>
<div class="wp_syntax"><div class="code"><pre class="ruby">  <span style="color:#9966CC; font-weight:bold;">def</span> create
    <span style="color:#0066ff; font-weight:bold;">@advertisement</span> = Advertisement.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:advertisement</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@advertisement</span>.<span style="color:#9900CC;">update_check_list</span><span style="color:#006600; font-weight:bold;">&#40;</span>params, <span style="color:#996600;">'Category'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    respond_to <span style="color:#9966CC; font-weight:bold;">do</span> |format|
      <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@advertisement</span>.<span style="color:#9900CC;">save</span>
        flash<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:message</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">'Advertisement was successfully created.'</span>
        <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">html</span> <span style="color:#006600; font-weight:bold;">&#123;</span> redirect_to advertisements_url <span style="color:#006600; font-weight:bold;">&#125;</span>
        <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">xml</span>  <span style="color:#006600; font-weight:bold;">&#123;</span> head <span style="color:#ff3333; font-weight:bold;">:created</span>, <span style="color:#ff3333; font-weight:bold;">:location</span> =&gt; advertisement_url<span style="color:#006600; font-weight:bold;">&#40;</span>@advertisement<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
      <span style="color:#9966CC; font-weight:bold;">else</span>
        assigns
        <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">html</span> <span style="color:#006600; font-weight:bold;">&#123;</span> render <span style="color:#ff3333; font-weight:bold;">:action</span> =&gt; <span style="color:#996600;">&quot;new&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
        <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">xml</span>  <span style="color:#006600; font-weight:bold;">&#123;</span> render <span style="color:#ff3333; font-weight:bold;">:xml</span> =&gt; <span style="color:#0066ff; font-weight:bold;">@advertisement</span>.<span style="color:#9900CC;">errors</span>.<span style="color:#9900CC;">to_xml</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
</p>



	<p>I still need to write a collection of tests for this plugin. If you have the time please write them for me!</p>
 ]]></content:encoded>
			<wfw:commentRss>http://scoop.simplyexcited.co.uk/2007/11/05/checkbox-select-rails-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

