<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	>
<channel>
	<title>Comments on: Testing Nested RESTful Resources in Rails</title>
	<atom:link href="http://nutrun.com/weblog/testing-nested-restful-resources-in-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://nutrun.com/weblog/testing-nested-restful-resources-in-rails/</link>
	<description>nutrun</description>
	<pubDate>Tue, 06 Jan 2009 05:58:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Web 2.0 Announcer</title>
		<link>http://nutrun.com/weblog/testing-nested-restful-resources-in-rails/comment-page-1/#comment-269</link>
		<dc:creator>Web 2.0 Announcer</dc:creator>
		<pubDate>Thu, 03 Jan 2008 16:21:30 +0000</pubDate>
		<guid isPermaLink="false">http://new-site.nutrun.com/?p=84#comment-269</guid>
		<description>&lt;strong&gt;Nutrun » Blog Archive » Testing Nested RESTful Resources in Rails...&lt;/strong&gt;

[...][...]...</description>
		<content:encoded><![CDATA[<p><strong>Nutrun » Blog Archive » Testing Nested RESTful Resources in Rails&#8230;</strong></p>
<p>[...][...]&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Malamidis</title>
		<link>http://nutrun.com/weblog/testing-nested-restful-resources-in-rails/comment-page-1/#comment-268</link>
		<dc:creator>George Malamidis</dc:creator>
		<pubDate>Tue, 20 Mar 2007 15:28:16 +0000</pubDate>
		<guid isPermaLink="false">http://new-site.nutrun.com/?p=84#comment-268</guid>
		<description>You need to add a mapping in config/routes.rb similar to:

map.connect 'songs', :controller =&gt; 'songs', :action =&gt; 'list'

Then create the 'list' action in songs_controller.rb:

def list
@songs = Song.find(:all)
end

And the corresponding view - app/views/songs/list.rhtml

Also, make sure the 'capture_artist' filter method doesn't complain when an artist_id is not present. Something like this should do the job:

def capture_artist
@artist = Artist.find(params[:artist_id]) unless params[:artist_id].nil?
end</description>
		<content:encoded><![CDATA[<p>You need to add a mapping in config/routes.rb similar to:</p>
<p>map.connect &#8217;songs&#8217;, :controller => &#8217;songs&#8217;, :action => &#8216;list&#8217;</p>
<p>Then create the &#8216;list&#8217; action in songs_controller.rb:</p>
<p>def list<br />
@songs = Song.find(:all)<br />
end</p>
<p>And the corresponding view - app/views/songs/list.rhtml</p>
<p>Also, make sure the &#8216;capture_artist&#8217; filter method doesn&#8217;t complain when an artist_id is not present. Something like this should do the job:</p>
<p>def capture_artist<br />
@artist = Artist.find(params[:artist_id]) unless params[:artist_id].nil?<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joost baaij</title>
		<link>http://nutrun.com/weblog/testing-nested-restful-resources-in-rails/comment-page-1/#comment-267</link>
		<dc:creator>joost baaij</dc:creator>
		<pubDate>Mon, 19 Mar 2007 12:16:04 +0000</pubDate>
		<guid isPermaLink="false">http://new-site.nutrun.com/?p=84#comment-267</guid>
		<description>Would it be possible to list all songs in the database, using only the routes you have?

I know that /artists/1/songs works, but would /songs work too? I have not been able to get this running, but it seems I should be able to.

As far as I can tell, once nested the 'parent' resource must always be present in the url. If you have figured out a way around this, I sure would love to know!</description>
		<content:encoded><![CDATA[<p>Would it be possible to list all songs in the database, using only the routes you have?</p>
<p>I know that /artists/1/songs works, but would /songs work too? I have not been able to get this running, but it seems I should be able to.</p>
<p>As far as I can tell, once nested the &#8216;parent&#8217; resource must always be present in the url. If you have figured out a way around this, I sure would love to know!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
