<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Amateur Hour with Jordan Isip - Home</title>
  <id>tag:blog.jordanisip.com,2007:mephisto/</id>
  <generator version="0.7.3" uri="http://mephistoblog.com">Mephisto Noh-Varr</generator>
  <link href="http://blog.jordanisip.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://blog.jordanisip.com/" rel="alternate" type="text/html"/>
  <updated>2007-10-21T19:40:31Z</updated>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-10-21:45</id>
    <published>2007-10-21T19:38:00Z</published>
    <updated>2007-10-21T19:40:31Z</updated>
    <link href="http://blog.jordanisip.com/2007/10/21/hidden-authors-and-comments-on-dailycaption" rel="alternate" type="text/html"/>
    <title>Hidden Authors and Comments on DailyCaption</title>
<content type="html">
            By popular demand, the caption author and caption comments are now hidden until voted on.
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-10-01:44</id>
    <published>2007-10-01T07:19:00Z</published>
    <updated>2007-10-01T07:43:56Z</updated>
    <link href="http://blog.jordanisip.com/2007/10/1/better-quality-and-more-accurate-photos-on-dailycaption" rel="alternate" type="text/html"/>
    <title>Better quality and more accurate photos on DailyCaption</title>
<content type="html">
            &lt;p&gt;Many of you on &lt;a href=&quot;http://www.dailycaption.com&quot;&gt;DailyCaption&lt;/a&gt; asked, and it is now finally here - pulling Flickr photos with multiple tags.  For now, you can add Comma separate tags for AND searches.  So for example, if you wanted to generate a photo that had the tags crazy AND sexy AND cool, you can add &#8220;crazy, sexy, cool&#8221; as a single tag.  Sort of ghetto for now but it is one way to have more control over the generated Flickr photos. I may change it so that it uses all of your tags in your tag pool to generate a photo.  Thoughts? Suggestions?&lt;/p&gt;

&lt;p&gt;Additionally, when DailyCaption goes out to Flickr to find a new photo, it is now sorting the photos by &#8216;most interesting&#8217; on Flickr, so hopefully this will pull some interesting photos and not &lt;a href=&quot;http://www.dailycaption.com/peanut_gallery/show_photo/2007-09-11&quot;&gt;Pis Spamcilar&lt;/a&gt; again.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-09-24:41</id>
    <published>2007-09-24T07:45:00Z</published>
    <updated>2007-09-24T08:22:09Z</updated>
    <link href="http://blog.jordanisip.com/2007/9/24/new-features-on-dailycaption" rel="alternate" type="text/html"/>
    <title>New Features on DailyCaption</title>
<content type="html">
            &lt;p&gt;Based off of a few suggestions made by the DailyCaption community, I&#8217;ve made a few updates to DailyCaption!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.dailycaption.com/info/faq#tie&quot;&gt;New tie breaker rules&lt;/a&gt;
The old tie breaker system had a loophole.  A suggestion by &lt;a href=&quot;http://www.dailycaption.com/profile/zyxtcba&quot;&gt;zyxtcba&lt;/a&gt; resolved this.  Here are the new rules: If another caption has the same amount of caption points, DailyCaption will settle the tie by comparing the total votes. If there is still a tie, total number comments on the captions are compared, then the caption author points, then finally if everything is STILL equal, the tie goes to whichever user joined DailyCaption first.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.dailycaption.com/users&quot;&gt;Icons in users listing&lt;/a&gt;
Suggested by &lt;a href=&quot;http://www.dailycaption.com/profile/dbc&quot;&gt;dbc&lt;/a&gt;, there are no avatar icons in the user listing.  So if you haven&#8217;t already, &lt;a href=&quot;http://www.dailycaption.com/account/avatar&quot;&gt;add your profile avatar&lt;/a&gt;(must be logged in)!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.dailycaption.com/account/change_notifications&quot;&gt;Comment E-Mail Notifications&lt;/a&gt;
Suggested by &lt;a href=&quot;http://www.dailycaption.com/profile/ian&quot;&gt;Ian&lt;/a&gt;, &lt;a href=&quot;http://www.dailycaption.com/profile/leah&quot;&gt;Leah&lt;/a&gt;, and &lt;a href=&quot;http://www.dailycaption.com/profile/KarateRobot&quot;&gt;KarateRobot&lt;/a&gt;, you will now get an e-mail if somebody (other than yourself) posts a comment on your caption. If you are not a fan of e-mail notifications, you can easily opt-out by &lt;a href=&quot;http://www.dailycaption.com/account/change_notifications&quot;&gt;changing your e-mail notification settings on your account&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.dailycaption.com/&quot;&gt;More Captions Per Page&lt;/a&gt;
Lastly, as suggested by &lt;a href=&quot;http://www.dailycaption.com/profile/McQDew&quot;&gt;McQDew&lt;/a&gt; there are now 15 captions per page instead of 8. &lt;/p&gt;

&lt;p&gt;If you have any questions/comments/suggestions for DailyCaption, please either reply to this blog post or &lt;a href=&quot;http://www.dailycaption.com/feedback/&quot;&gt;post on the feedback form&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;See you on DailyCaption!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-09-15:38</id>
    <published>2007-09-15T23:43:00Z</published>
    <updated>2007-09-15T23:46:56Z</updated>
    <link href="http://blog.jordanisip.com/2007/9/15/new-dailycaption-google-gadget" rel="alternate" type="text/html"/>
    <title>New DailyCaption Google "Gadget"!</title>
<content type="html">
            &lt;p&gt;You can now see the daily photo along with the #1 caption on your &lt;a href=&quot;http://www.google.com/ig?hl=en&quot;&gt;iGoogle homepage&lt;/a&gt;! Just &lt;a href=&quot;http://www.google.com/ig/adde?moduleurl=http://www.dailycaption.com/captions/google&quot;&gt;add the DailyCaption gadget&lt;/a&gt; to your iGoogle!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-09-14:37</id>
    <published>2007-09-14T01:26:00Z</published>
    <updated>2007-09-14T01:40:32Z</updated>
    <link href="http://blog.jordanisip.com/2007/9/14/ads-on-dailycaption" rel="alternate" type="text/html"/>
    <title>Ads on DailyCaption?!?</title>
<content type="html">
            &lt;p&gt;No your eyes are not deceiving you, there are indeed ads on &lt;a href=&quot;http://www.dailycaption.com&quot;&gt;DailyCaption&lt;/a&gt; as of earlier tonight.  As you may know or may have heard from some geek on the streets, servers and bandwidth aren&#8217;t free!  Hopefully these ads will raise enough money to pay for the servers and  I&#8217;m also hoping to raise enough money to have monthly or even weekly contests in the near future!  So please help support DailyCaption by clicking on the ads! :D I hope they don&#8217;t get in the way of your captioning too much!&lt;/p&gt;

&lt;p&gt;See you on DailyCaption!  As always, please use the &lt;a href=&quot;http://www.dailycaption.com/feedback&quot;&gt;suggestion form&lt;/a&gt; or reply to this post if you have any comments or suggestions.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-09-12:36</id>
    <published>2007-09-12T22:57:00Z</published>
    <updated>2007-09-12T23:02:05Z</updated>
    <link href="http://blog.jordanisip.com/2007/9/12/better-rss-feeds-for-dailycaption" rel="alternate" type="text/html"/>
    <title>Better RSS Feeds for DailyCaption!</title>
<content type="html">
            &lt;p&gt;Based off of your suggestions, I&#8217;ve added new and better RSS Feeds! You can now see the daily photos along with your captions! You can now subscribe to:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.dailycaption.com/captions/feed_photos&quot;&gt;Recent photos with the number 1 caption for each photo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.dailycaption.com/captions/feed_today&quot;&gt;Today&#8217;s Captions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.dailycaption.com/captions/feed&quot;&gt;Recent Captions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have a suggestion or if you found a bug on DailyCaption, please &lt;a href=&quot;http://www.dailycaption.com/feedback&quot;&gt;let me know&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;See you on DailyCaption!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-09-10:31</id>
    <published>2007-09-10T09:12:00Z</published>
    <updated>2007-09-10T09:19:06Z</updated>
    <link href="http://blog.jordanisip.com/2007/9/10/share-your-captions" rel="alternate" type="text/html"/>
    <title>Share your captions!</title>
<content type="html">
            &lt;p&gt;You can now easily share you captions on &lt;a href=&quot;http://www.dailycaption.com&quot;&gt;DailyCaption&lt;/a&gt;!  Send your captions to your friends or even send them to your rivals to rub it in their face.  Just click the &#8220;Share&#8221; link next to the comments link on each caption. From there you can post your caption (or captions that you like) on the your &lt;a href=&quot;http://www.facebook.com&quot;&gt;Facebook&lt;/a&gt; profile, &lt;a href=&quot;http://www.twitter.com&quot;&gt;Twitter&lt;/a&gt; account, &lt;a href=&quot;http://www.delicious.com&quot;&gt;Delicious&lt;/a&gt; bookmarks, &lt;a href=&quot;http://www.digg.com&quot;&gt;Digg&lt;/a&gt;, or &lt;a href=&quot;http://www.reddit.com&quot;&gt;Reddit&lt;/a&gt;.  I&#8217;ll be adding the ability to send captions to your friends through email sometime soon :D&lt;/p&gt;

&lt;p&gt;Good luck on Today&#8217;s Daily Caption contest!  Start sharing your captions!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-09-09:30</id>
    <published>2007-09-09T06:58:00Z</published>
    <updated>2007-09-09T07:10:56Z</updated>
    <link href="http://blog.jordanisip.com/2007/9/9/mobile-dailycaption" rel="alternate" type="text/html"/>
    <title>Mobile DailyCaption!</title>
<content type="html">
            &lt;p&gt;If you are a mobile internet (PDA/Cell Phone), you are in for a treat!  Although it has very very limited functionality, II just put together a mobile version of DailyCaption!.  It is a read only version of today&#8217;s photo and captions.  I created it so that I can keep track of the contest while I&#8217;m out and about!  Check it out: &lt;a href=&quot;http://www.dailycaption.com/mobile&quot;&gt;http://www.dailycaption.com/mobile&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-09-07:29</id>
    <published>2007-09-07T05:46:00Z</published>
    <updated>2007-09-07T07:22:41Z</updated>
    <link href="http://blog.jordanisip.com/2007/9/7/links-in-your-profile-and-some-additional-press" rel="alternate" type="text/html"/>
    <title>Links in your profile and some additional press!</title>
<content type="html">
            &lt;h3&gt;New Functionality&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;http://www.dailycaption.com/profile/blush_response&quot;&gt;blush_response&lt;/a&gt; submitted a suggestion on the &lt;a href=&quot;http://www.dailycaption.com/feedback&quot;&gt;suggestion form&lt;/a&gt; to add website/blog URLs and Flickr URLs to user profiles.  Ask and you shall receive (sometimes :D).  You can now add your URLs and Flickr URLs to your profile so we can all stalk you!&lt;/p&gt;

&lt;h3&gt;New Press&lt;/h3&gt;

&lt;p&gt;Also, DailyCaption got a little bit more press!:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.dailycaption.com/profile/emilychang&quot;&gt;Emily Chang&lt;/a&gt;’s &lt;a href=&quot;http://www.emilychang.com/go/ehub/app/dailycaption/&quot;&gt;E-hub&lt;/a&gt; (thanks for the heads up &lt;a href=&quot;http://www.zielonemigdaly.pl/&quot;&gt;Barbez&lt;/a&gt;) along with &lt;a href=&quot;http://www.web2null.de/dailycaption&quot;&gt;Web2Null&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://cssmania.com/galleries/2007/09/06/daily-caption.php&quot;&gt;Front page on CSSMania&lt;/a&gt;!  Please vote DailyCaption up!&lt;/p&gt;

&lt;h3&gt;DailyCaption Stats&lt;/h3&gt;

&lt;p&gt;DailyCaption stats within the past 48 hours (since the public launch):&lt;/p&gt;

&lt;p&gt;2,308 Visits
8,266 Pageviews&lt;/p&gt;

&lt;h3&gt;Help DailyCaption&lt;/h3&gt;

&lt;p&gt;Don&#8217;t forget to &lt;a href=&quot;http://www.digg.com/search?section=news&amp;amp;s=dailycaption&quot;&gt;Digg DailyCaption&lt;/a&gt; and tell your friends!! Thanks :D &lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-09-06:27</id>
    <published>2007-09-06T04:16:00Z</published>
    <updated>2007-09-06T04:34:49Z</updated>
    <link href="http://blog.jordanisip.com/2007/9/6/dailycaption-on-mashable" rel="alternate" type="text/html"/>
    <title>DailyCaption on Mashable and KillerStartups</title>
<content type="html">
            &lt;p&gt;Yay! &lt;a href=&quot;http://www.dailycaption.com/&quot;&gt;DailyCaption&lt;/a&gt; got it&#8217;s first write up! Check it out on &lt;a href=&quot;http://mashable.com/2007/09/05/dailycaption/&quot;&gt;Mashable&lt;/a&gt;! &lt;/p&gt;

&lt;p&gt;Update: Another writeup on &lt;a href=&quot;http://www.killerstartups.com/Web20/dailycaption&#8211;Compete-for-the-Best-Caption/&quot;&gt;KillerStartups&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-09-05:26</id>
    <published>2007-09-05T17:47:00Z</published>
    <updated>2007-09-05T17:50:57Z</updated>
    <link href="http://blog.jordanisip.com/2007/9/5/setting-up-a-marketing-campaign" rel="alternate" type="text/html"/>
    <title>Setting up a marketing campaign!</title>
<content type="html">
            &lt;p&gt;Watch out for DailyCaption ads!  I just started a marketing campaign through AdBrite! Please help spread the word! Please vote it up on &lt;a href=&quot;http://www.cssreboot.com/DailyReboot/DailyCaption&#8211;Taking-Flickr-photos-out-context-/&quot;&gt;CSSReboot&lt;/a&gt; and add a review on &lt;a href=&quot;http://simplespark.com/catalog/dailycaption/&quot;&gt;SimpleSpark&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for the help!!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-09-05:25</id>
    <published>2007-09-05T09:00:00Z</published>
    <updated>2007-09-05T09:07:04Z</updated>
    <link href="http://blog.jordanisip.com/2007/9/5/sorry-for-the-double-activation-e-mail" rel="alternate" type="text/html"/>
    <title>Sorry for the Double Activation E-mail!</title>
<content type="html">
            &lt;p&gt;I apologize for sending double activation e-mails on DailyCaption!  That was my bad - seeing as how I can&#8217;t really blame anyone else ;)  Thanks to whomever submitted the bug in the suggestion/feedback box!! I would have sent you an email directly, however, you weren&#8217;t logged in at the time so all I see is &#8220;Guest&#8221;. :(&lt;/p&gt;

&lt;p&gt;To anyone that is reading, please help spread the word on &lt;a href=&quot;http://digg.com/tech_news/Think_you_re_funny_Get_validation_with_caption_contests_on_Flickr_images&quot;&gt;Digg&lt;/a&gt; and &lt;a href=&quot;http://reddit.com/info/2lwhf/comments&quot;&gt;Reddit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See you on DailyCaption!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-09-05:24</id>
    <published>2007-09-05T06:14:00Z</published>
    <updated>2007-09-05T06:31:24Z</updated>
    <link href="http://blog.jordanisip.com/2007/9/5/dailycaption-com-released" rel="alternate" type="text/html"/>
    <title>DailyCaption.com Released!</title>
<content type="html">
            &lt;p&gt;My DailyCaption project is ready for public use!! DailyCaption is a community that takes Flickr photos out of context. Each night, a new Flickr photo is generated for members to contribute new captions and rate others.&lt;/p&gt;

&lt;p&gt;Think you&#8217;re clever? Post captions on Flickr photos at &lt;a href=&quot;http://www.dailycaption.com&quot;&gt;http://www.dailycaption.com&lt;/a&gt; !&lt;/p&gt;

&lt;p&gt;See you there!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-08-20:21</id>
    <published>2007-08-20T06:20:00Z</published>
    <updated>2007-08-20T07:17:08Z</updated>
    <link href="http://blog.jordanisip.com/2007/8/20/pro-tip-google-maps-kc-metro-transit" rel="alternate" type="text/html"/>
    <title>Pro Tip: Google Maps + KC Metro Transit + GIS</title>
<content type="html">
            &lt;h2&gt;Problem&lt;/h2&gt;

&lt;p&gt;You are having a hard time figuring out the bus system in Seattle or interpreting the &lt;a href=&quot;http://tripplanner.metrokc.gov/cgi-bin/itin_page.pl?resptype=U&quot;&gt;MetroKC Trip Planner&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Solution&lt;/h2&gt;

&lt;p&gt;Quick pro tip with &lt;a href=&quot;http://maps.google.com&quot;&gt;Google Maps&lt;/a&gt; and &lt;a href=&quot;http://transit.metrokc.gov&quot;&gt;King County Metro Transit&lt;/a&gt;.  I may be an Amateur at Ruby on Rails but I am a pro Seattle bus rider.  &lt;/p&gt;

&lt;p&gt;First off, check out &lt;a href=&quot;http://www.google.com/transit&quot;&gt;Google Transit&lt;/a&gt; if you haven&#8217;t already.  &lt;a href=&quot;http://www.google.com/transit&quot;&gt;Google Transit&lt;/a&gt; is basically the &lt;a href=&quot;http://maps.google.com&quot;&gt;Google Maps&lt;/a&gt; version of &lt;a href=&quot;http://tripplanner.metrokc.gov/cgi-bin/itin_page.pl?resptype=U&quot;&gt;MetroKC Trip Planner&lt;/a&gt;.  So instead of just seeing point A bus stop and point B bus stop in text, Google Transit presents the data in map form.  Pro tip: Keep in mind that at times Google Transit Data is wrong.  When in doubt or if it is a new route you are taking, be sure to double check with MetroKC - especially if you are riding on a holiday!&lt;/p&gt;

&lt;p&gt;Now onto something that I recently discovered.  If you zoom into Google Maps..err&#8230; &lt;a href=&quot;http://maps.google.com/?ie=UTF8&amp;amp;ll=47.611429,-122.33831&amp;amp;spn=0.001779,0.003498&amp;amp;z=18&amp;amp;iwloc=0x54906ab35c0e858d:0x693f96b5fa60e1a4&amp;amp;om=1&quot;&gt;zoom way in&lt;/a&gt;.  You will see small bus icons representing bus stops.  Click on one of those bus icons to see which buses stop at that bus stop including upcoming arrival times.  This is very very useful if you already know what bus you are going to take and just need to know when it is coming next.&lt;/p&gt;

&lt;p&gt;Although wait, what&#8217;s missing here?  On &lt;a href=&quot;http://www.busmonster.com&quot;&gt;busmonster.com&lt;/a&gt;, which also used to map MetroKC Transit data, it used to show a line on the map showing the exact route of the bus and even the location of where the bus should be at the given time.  This is a great feature for those whom haven&#8217;t ridden the route before. Anyone know why the Google Map on Busmonster has been down for months?&lt;/p&gt;

&lt;p&gt;Lastly, maybe this is a pipe dream (or a future project of mine), but I wish Google maps could be used for figuring out trips by bike.  To do this they would not only have to exclude highways but it would have to incorporate topology data to help weigh results - along, of course, with a bunch of other criteria (ie. bike paths, bike lanes, congestion, etc.).  This way I would know before I ride that going from &lt;a href=&quot;http://maps.google.com/?ie=UTF8&amp;amp;om=1&amp;amp;ll=47.612557,-122.342677&amp;amp;spn=0.007117,0.01399&amp;amp;z=16&quot;&gt;Western to 4th in the Financial District&lt;/a&gt; is a heck of a lot harder than going from &lt;a href=&quot;http://maps.google.com/?ie=UTF8&amp;amp;om=1&amp;amp;ll=47.612557,-122.342677&amp;amp;spn=0.007117,0.01399&amp;amp;z=16&quot;&gt;Western to 4th in Belltown&lt;/a&gt;.  You&#8217;ll just have to believe me on that one :)  Anyone know of some sort of Mashup that is already doing this?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Geographic_information_system&quot;&gt;Go GIS&lt;/a&gt;, make me proud!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.jordanisip.com/">
    <author>
      <name>admin</name>
    </author>
    <id>tag:blog.jordanisip.com,2007-07-05:10</id>
    <published>2007-07-05T19:45:00Z</published>
    <updated>2007-07-20T23:25:50Z</updated>
    <link href="http://blog.jordanisip.com/2007/7/5/custom-helper-tags-in-your-view" rel="alternate" type="text/html"/>
    <title>Custom helper tags in your view</title>
<content type="html">
            &lt;h2&gt;Problem&lt;/h2&gt;

&lt;p&gt;Your view code in your Ruby on Rails app is getting messy with duplicate code and ugly conditional statements.  For example, maybe you have something in your view that displays the user&#8217;s avatar (that is, if the user has uploaded one already) such as:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&amp;lt;% if current_user.avatar %&amp;gt;
    &amp;lt;%= image_tag(current_user.avatar.public_filename(:thumb) %&amp;gt;
&amp;lt;% else %&amp;gt;
    &amp;lt;%= image_tag(&amp;quot;avatar_thumb.png&amp;quot;) %&amp;gt;
&amp;lt;% end %&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Solution&lt;/h2&gt;

&lt;p&gt;Create &lt;a href=&quot;http://wiki.rubyonrails.org/rails/pages/HowtoWorkWithHelpers&quot;&gt;custom helper tags&lt;/a&gt;. An easy way to get into this is to look at the source of built in helpers and piggy back on them.  Don&#8217;t get too scared, the built in helpers are ones you already use like link_to, image_tag, etc.  For this example, let&#8217;s build on the image_tag to write a custom &#8220;avatar_tag&#8221; helper.  &lt;/p&gt;

&lt;p&gt;With this call from the view we want to trigger an &#8220;avatar_tag&#8221; helper method in our rails_app/helpers/application_helper.rb that we will create.  You can also put it in your one of your controller specific helper modules if you don&#8217;t want this helper available system wide.&lt;/p&gt;

&lt;p&gt;Let&#8217;s first look at the &#8220;image_tag&#8221; helper that is built in to rails:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;# File src/rails-1.2.1/actionpack/lib/action_view/helpers/asset_tag_helper.rb, line 185
def image_tag(source, options = {})
  options.symbolize_keys!

  options[:src] = image_path(source)
  options[:alt] ||= File.basename(options[:src], '.*').split('.').first.capitalize

  if options[:size]
      options[:width], options[:height] = options[:size].split(&amp;quot;x&amp;quot;) if options[:size] =~ %r{^\d+x\d+$}
      options.delete(:size)
  end

  tag(&amp;quot;img&amp;quot;, options)
 end&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Let&#8217;s dissect this a bit&#8230;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, the method is accepting a source location and a hash of HTML options (options={}) that we can pass in to override the default values. (such as :alt, :width, etc)&lt;/li&gt;
&lt;li&gt;Inside the image_tag method, options.symbolize_keys! is going to turn our options hash into a new hash with all the keys converted to symbols.&lt;/li&gt;
&lt;li&gt;Next it is going to assign the HTML src option to the source that we pass in.&lt;/li&gt;
&lt;li&gt;Same goes to any other options if we passed them in to override any defaults.  For example, if we called image_tag(&#8220;logo.png&#8221;, {:alt=&gt;&#8221;This is a temp logo&#8221;}), it would override the default alt value that image_tag provides (the src of the image).&lt;/li&gt;
&lt;li&gt;Finally, it is going to use the &lt;a href=&quot;http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#M000597&quot;&gt;tag&lt;/a&gt; method to create the actual HTML tag.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let&#8217;s create our own &#8220;avatar_tag&#8221; helper - which, as we can see, doesn&#8217;t look too different:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;def avatar_tag(asset, options = {})
        options.symbolize_keys!

        options[:class] ||= :thumb
        options[:alt] ||= (asset) ? asset.public_filename : &amp;quot;No Avatar Found&amp;quot;

        #buddyicon_tiny.png and buddyicon_thumb.png should be in app directory
        options[:src] = (asset) ? asset.public_filename(options[:class]) : &amp;quot;/images/buddyicon_#{options[:class].to_s}.png&amp;quot;

        tag(:img, options)
    end&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;What&#8217;s new here?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First of all we are calling our new method &#8220;avatar_tag&#8221; - which we will then be able to call from any of our views (since we put it in the application helper).&lt;/li&gt;
&lt;li&gt;We are using the attribute &#8220;class&#8221; to define the type of avatar to use.  We also set it so that it is :thumb by default.&lt;/li&gt;
&lt;li&gt;For the alt attribute, we set the default to the filename when the source is not nil and set it to &#8220;No Avatar Found&#8221; if it is nil.&lt;/li&gt;
&lt;li&gt;Finally, we set the source to be the avatar source if source is not nil and if it is nil we set it to our default avatar image.  Note that we are also passing in options[:class] in the filename so we will need to name our default images - avatar_thumb.png and avatar_tiny.png&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now rather than those conditionals clogging up our view template, we can simply render our :tiny version of our user&#8217;s avatar icon by calling:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&amp;lt;%= avatar_tag(current_user.avatar, :class=&amp;gt;:tiny) %&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;or the :thumb version by just calling:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&amp;lt;%= avatar_tag(current_user.avatar) %&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Mmm..much cleaner&#8230;..&lt;/p&gt;

&lt;p&gt;Good luck and as always, please post in the comments if you know/found a better way to do this!&lt;/p&gt;
          </content>  </entry>
</feed>
