<?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>Ruby on Rails Notes &#187; gotcha</title> <atom:link href="http://railsnotes.com/tag/gotcha/feed/" rel="self" type="application/rss+xml" /><link>http://railsnotes.com</link> <description>A code-heavy brain dump of stuff I come across working on Ruby on Rails projects including Models, ActiveRecord, Views, Controllers, RESTful rails, deployment, server stuff, etc.</description> <lastBuildDate>Sun, 29 Aug 2010 23:45:16 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Simple Routing Gotcha</title><link>http://railsnotes.com/50-simple-routing-gotcha/</link> <comments>http://railsnotes.com/50-simple-routing-gotcha/#comments</comments> <pubDate>Thu, 02 Oct 2008 18:15:59 +0000</pubDate> <dc:creator>Melvin Ram</dc:creator> <category><![CDATA[routes]]></category> <category><![CDATA[gotcha]]></category><guid
isPermaLink="false">http://railsnotes.wordpress.com/?p=50</guid> <description><![CDATA[Rails will always look at the public folder and serve that if it exists. If someone goes to yourdomain.com/monkey.html, it will look first at the public folder to see if there is a file that matches. If not, it will look for a route that matches. If no matching route exists, Rails will raise an [...]]]></description> <content:encoded><![CDATA[<p></p><p>Rails will always look at the public folder and serve that if it exists. If someone goes to yourdomain.com/monkey.html, it will look first at the public folder to see if there is a file that matches. If not, it will look for a route that matches. If no matching route exists, Rails will raise an exception (throw an error.)</p><p>Here&#8217;s the conversion that prompted this post:</p><blockquote><p>glennfu: I have this route in my routes.rb file: map.pages &#8216;/*path&#8217;, :controller =&gt; &#8220;pages&#8221;, :action =&gt; &#8220;show&#8221;</p><p>glennfu: but it&#8217;s catching too much&#8230; like my favicon and some stylesheets.  How can I make it smarter?</p><p><span
style="color:#008000">melvinram: Are they (the favicon &amp; stylesheets) in the public folder?</span></p><p>glennfu: yes</p><p><span
style="color:#008000">melvinram: Rails should look at the public folder first&#8230;</span></p><p>glennfu: perhaps that&#8217;s a clue, I&#8217;ll make sure they&#8217;re actually on the server&#8230;</p><p>glennfu: you spotted the problem, they&#8217;re actually not in the public folder!</p><p>glennfu: those files are missing</p></blockquote> ]]></content:encoded> <wfw:commentRss>http://railsnotes.com/50-simple-routing-gotcha/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 6/16 queries in 0.061 seconds using disk

Served from: railsnotes.com @ 2010-09-10 05:45:55 -->