<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>highslide &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/highslide/</link>
	<description>Feed of posts on WordPress.com tagged "highslide"</description>
	<pubDate>Thu, 24 Dec 2009 13:21:25 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Customizing Rails scaffolding to suit your app]]></title>
<link>http://railsrant.com/2009/08/28/customizing-rails-scaffolding-to-suit-your-app/</link>
<pubDate>Fri, 28 Aug 2009 14:28:52 +0000</pubDate>
<dc:creator>John</dc:creator>
<guid>http://railsrant.com/2009/08/28/customizing-rails-scaffolding-to-suit-your-app/</guid>
<description><![CDATA[OK&#8230;. I wish I would have tried this earlier.  It would have saved me alot of time.  The defaul]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>OK&#8230;. I wish I would have tried this earlier.  It would have saved me alot of time.  The default scaffolding that comes with Rails 2.3 is pretty good out of the box, but it is never going to fit exactly what you need for every app.  One of my apps is a bit different than the default scaffolding setup.  I have integrated <a title="Highslide Javascript Library" href="http://highslide.com/">Highslide</a> Javascript Library into my app for the administration functions.  It works very well.  If you havent used it, its basically a lightbox script that allows you to use iframe content (and alot of other stuff) inside the modal popup.  So when I need to edit or add something, I just click on it and a modal popup appears.  When I save it, it closes the modal popup and refreshes the page via ajax or a meta refresh depending on the needs of that page.  It gives you a nice smooth workflow.  Some of the calls to highslide are baked into the controller and views.  This is just one example of things I change from the default scaffolding.  There are plenty of other things I like to add to every controller and view, such as my home-brewed security methods and a shared form for edit/new.  All of this takes alot of time.</p>
<p>In the past I used scaffolding as my base point before I made all the changes.  It was still faster than coding it from scratch, but what if I could make scaffolding generate exactly what I want every time?!  It is actually much easier than I anticipated.  It took me about as much time to change the scaffolding as it did to change one of the resources I created with the scaffolding.  Here is what you need to do.</p>
<p>1.  Locate your Rails source directory &#8211; on my Mac it is located here: /Library/Ruby/Gems/1.8/gems/rails-2.3.2    I use Aptana Studio for development (yeah I know.. I should use Textmate.. whatever dude), so I just added the rails source as a project so I could edit it directly from the IDE.</p>
<p>2. Go to this directory -&#62;  rails-2.3.2/lib/rails_generator/generators/components/scaffold/ and first take a look at scaffold_generator.rb.   This class runs the scaffolding which creates all the files using the templates in the subdirectory /templates.  The first thing I wanted to customize in the scaffolding was adding a partial named form.  So I edited the method scaffold_views and added it to the end of the array like so:</p>
<div style="border:1px solid #dddddd;background-color:#eeeeee;padding:5px;">def scaffold_views<br />
#ADDED BY JOHN &#8211; _form<br />
%w[ index show new edit <span style="color:#ff0000;">_form</span>]<br />
end</div>
<p>Next I wanted to get rid of the layout file and css that are created when scaffolding runs.  I rarely use them since I use the base layout and main css for my whole site, so I commented out these lines:</p>
<div style="border:1px solid #dddddd;background-color:#eeeeee;padding:5px;">
<p>#m.directory(File.join(&#8216;app/views/layouts&#8217;, controller_class_path))</p>
<p>&#8230;&#8230;</p>
<p># Layout and stylesheet.<br />
#m.template(&#8216;layout.html.erb&#8217;, File.join(&#8216;app/views/layouts&#8217;, controller_class_path, &#8220;#{controller_file_name}.html.erb&#8221;))<br />
#m.template(&#8217;style.css&#8217;, &#8216;public/stylesheets/scaffold.css&#8217;)</p></div>
<p>The possibilities in this file are endless.  Just add/remove whatever you want to/from <strong>def manifest</strong></p>
<p>3.  Next you can edit the templates that you want to customize.    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails_generator/generators/components/scaffold/templates</p>
<p>I edited the controller template and all of the views.  You will notice that the template uses ruby code for some of the generation:</p>
<div style="border:1px solid #dddddd;background-color:#eeeeee;padding:5px;">&#60;% for attribute in attributes -%&#62;<br />
&#60;th&#62;&#60;%= attribute.column.human_name %&#62;&#60;/th&#62;<br />
&#60;% end -%&#62;</div>
<p>Basically you can code it with ruby and it the generator will spit out a string which it writes to the .rb files.  Think of it as code inside code.</p>
<p>I am not exactly sure what this means though, maybe someone can enlighten me: <strong> &#60;%%=</strong></p>
<div style="border:1px solid #dddddd;background-color:#eeeeee;padding:5px;">&#60;%%= link_to &#8216;Show&#8217;, &#60;%= singular_name %&#62; %&#62;</div>
<p>I am assuming its something like escaping a quote.. but I dont really have a clue.  I was still able to get it to output the code I wanted without knowing exactly what it does.</p>
<p>Anyways&#8230; You can change these files around to spit out the code you want.  Its very easy to customize and it can save you a ton of time if you are a heavy scaffolding user.  There is probably a way to turn this into a plugin or use a symlink, so you don&#8217;t have to edit the original files, but I guess I am lazy.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[www.geb.com.my]]></title>
<link>http://chunket.wordpress.com/2009/07/08/www-geb-com-my/</link>
<pubDate>Tue, 07 Jul 2009 18:19:04 +0000</pubDate>
<dc:creator>chunket</dc:creator>
<guid>http://chunket.wordpress.com/2009/07/08/www-geb-com-my/</guid>
<description><![CDATA[Forum]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignnone size-full wp-image-14" title="screenshot (3)" src="http://chunket.wordpress.com/files/2009/07/screenshot-3.png" alt="screenshot (3)" width="480" height="558" /></p>
<p><strong>Forum</strong></p>
<p><img class="alignnone size-full wp-image-15" title="screenshot (4)" src="http://chunket.wordpress.com/files/2009/07/screenshot-4.png" alt="screenshot (4)" width="480" height="408" /></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[www.banting.com.my]]></title>
<link>http://chunket.wordpress.com/2009/07/08/www-banting-com-my/</link>
<pubDate>Tue, 07 Jul 2009 18:00:31 +0000</pubDate>
<dc:creator>chunket</dc:creator>
<guid>http://chunket.wordpress.com/2009/07/08/www-banting-com-my/</guid>
<description><![CDATA[]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignnone size-full wp-image-8" title="screenshot" src="http://chunket.wordpress.com/files/2009/07/screenshot.png" alt="screenshot" width="480" height="431" /></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[整理 Box Window 效果的 JavaScript]]></title>
<link>http://nighter.wordpress.com/2009/03/04/jsbox/</link>
<pubDate>Wed, 04 Mar 2009 11:25:49 +0000</pubDate>
<dc:creator>席安</dc:creator>
<guid>http://nighter.wordpress.com/2009/03/04/jsbox/</guid>
<description><![CDATA[所謂的 Box Window 就是在網頁中開啟一個視窗（非新視窗） 而開啟的視窗會出現在網頁正中央 並暗化周圍區塊將重點強調出來 下面列了一些知名度比較高的 JavaScript 他們除了能達到上序功]]></description>
<content:encoded><![CDATA[所謂的 Box Window 就是在網頁中開啟一個視窗（非新視窗） 而開啟的視窗會出現在網頁正中央 並暗化周圍區塊將重點強調出來 下面列了一些知名度比較高的 JavaScript 他們除了能達到上序功]]></content:encoded>
</item>
<item>
<title><![CDATA[Plugins und Design]]></title>
<link>http://sven77.wordpress.com/2008/04/16/plugins-und-design/</link>
<pubDate>Wed, 16 Apr 2008 06:48:20 +0000</pubDate>
<dc:creator>sven77</dc:creator>
<guid>http://sven77.wordpress.com/2008/04/16/plugins-und-design/</guid>
<description><![CDATA[Ich habe meinem Blog und mit mal wieder ein paar Plugins spendiert bzw. manche nur getestet. Dabei h]]></description>
<content:encoded><![CDATA[Ich habe meinem Blog und mit mal wieder ein paar Plugins spendiert bzw. manche nur getestet. Dabei h]]></content:encoded>
</item>
<item>
<title><![CDATA[Facebook, please implement this!]]></title>
<link>http://beunreasonable.org/2008/03/22/facebook-please-implement-this/</link>
<pubDate>Sat, 22 Mar 2008 03:51:19 +0000</pubDate>
<dc:creator>beunreasonable</dc:creator>
<guid>http://beunreasonable.org/2008/03/22/facebook-please-implement-this/</guid>
<description><![CDATA[In one word, wow! I&#8217;d love to see Facebook implement something like this for viewing its photo]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img src="http://www.webappers.com/img/2007/10/minishowcase.png" height="334" width="480" /></p>
<p><b>In one word, wow!</b></p>
<p>I&#8217;d love to see Facebook implement something like this for viewing its photo albums:</p>
<p><a href="http://www.paulvanroekel.nl/picasa/highslidedemo/">http://www.paulvanroekel.nl/picasa/highslidedemo/</a></p>
<p>Aydin.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[www.barisankilat.com.my]]></title>
<link>http://chunket.wordpress.com/2009/07/08/www-barisankilat-com-my/</link>
<pubDate>Tue, 07 Jul 2009 18:10:00 +0000</pubDate>
<dc:creator>chunket</dc:creator>
<guid>http://chunket.wordpress.com/2009/07/08/www-barisankilat-com-my/</guid>
<description><![CDATA[]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignnone size-full wp-image-25" title="screenshot (14)" src="http://chunket.wordpress.com/files/2009/07/screenshot-14.png" alt="screenshot (14)" width="480" height="838" /></p>
<p><img class="alignnone size-full wp-image-29" title="screenshot (18)" src="http://chunket.wordpress.com/files/2009/07/screenshot-18.png" alt="screenshot (18)" width="480" height="483" /></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
