<?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: Rails: Nested resource scaffold</title> <atom:link href="http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/feed/" rel="self" type="application/rss+xml" /><link>http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/</link> <description>Code Monkey</description> <lastBuildDate>Sat, 13 Mar 2010 07:28:35 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: Santiago GL</title><link>http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/comment-page-1/#comment-4336</link> <dc:creator>Santiago GL</dc:creator> <pubDate>Sun, 23 Dec 2007 17:32:13 +0000</pubDate> <guid
isPermaLink="false">http://beta.ariejan.net/?p=76#comment-4336</guid> <description>I am using Rails 1.2.4.
When recipes_controller.rb does NOT exist, the mapping to /recipes/1/ingredients does show the ingredients that belong to recipe 1.
That&#039;s ok!
But when recipes_controller.rb DOES exist, the nested resource (/recipes/1/ingredients) outputs
&lt;blockquote&gt;Unknown action \ No action responded to 1&lt;/blockquote&gt;
If I call /recipes/1.xml/ingredients it outputs a routing error, that is, there is no route to that resource.
What am I doing wrong?
Thanks</description> <content:encoded><![CDATA[<p>I am using Rails 1.2.4.<br
/> When recipes_controller.rb does NOT exist, the mapping to /recipes/1/ingredients does show the ingredients that belong to recipe 1.<br
/> That&#8217;s ok!<br
/> But when recipes_controller.rb DOES exist, the nested resource (/recipes/1/ingredients) outputs</p><blockquote><p>Unknown action \ No action responded to 1</p></blockquote><p>If I call /recipes/1.xml/ingredients it outputs a routing error, that is, there is no route to that resource.<br
/> What am I doing wrong?<br
/> Thanks</p> ]]></content:encoded> </item> <item><title>By: Ariejan de Vroom</title><link>http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/comment-page-1/#comment-3955</link> <dc:creator>Ariejan de Vroom</dc:creator> <pubDate>Wed, 12 Dec 2007 06:45:37 +0000</pubDate> <guid
isPermaLink="false">http://beta.ariejan.net/?p=76#comment-3955</guid> <description>@Brian: Just like you nested ingredients into recipes, you can nest recipes in books. Note that this means that you&#039;ll have to use books_recipe_ingredients_url(@book, @recipe, @ingredient))You can do this. But if you stuff the same recipies in different books, I wouldn&#039;t nest &#039;em.Good luck with your app.</description> <content:encoded><![CDATA[<p>@Brian: Just like you nested ingredients into recipes, you can nest recipes in books. Note that this means that you&#8217;ll have to use books_recipe_ingredients_url(@book, @recipe, @ingredient))</p><p>You can do this. But if you stuff the same recipies in different books, I wouldn&#8217;t nest &#8216;em.</p><p>Good luck with your app.</p> ]]></content:encoded> </item> <item><title>By: Brian</title><link>http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/comment-page-1/#comment-3942</link> <dc:creator>Brian</dc:creator> <pubDate>Tue, 11 Dec 2007 22:13:07 +0000</pubDate> <guid
isPermaLink="false">http://beta.ariejan.net/?p=76#comment-3942</guid> <description>What if recipes where in books.  so you wanted book/:id/recipe/:id/ingredients
How would the route.rb look then - can you double nest or should you just not do this?  We have a lot of these situations.</description> <content:encoded><![CDATA[<p>What if recipes where in books.  so you wanted book/:id/recipe/:id/ingredients<br
/> How would the route.rb look then &#8211; can you double nest or should you just not do this?  We have a lot of these situations.</p> ]]></content:encoded> </item> <item><title>By: matthijs</title><link>http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/comment-page-1/#comment-183</link> <dc:creator>matthijs</dc:creator> <pubDate>Fri, 31 Aug 2007 09:24:20 +0000</pubDate> <guid
isPermaLink="false">http://beta.ariejan.net/?p=76#comment-183</guid> <description>oops the code in my comment should be:
&lt;code&gt;
url_for([@matter.client, @matter]) do &#124;f&#124;
&lt;/code&gt;</description> <content:encoded><![CDATA[<p>oops the code in my comment should be:<br
/> <code><br
/> url_for([@matter.client, @matter]) do |f|<br
/> </code></p> ]]></content:encoded> </item> <item><title>By: Matthijs</title><link>http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/comment-page-1/#comment-188</link> <dc:creator>Matthijs</dc:creator> <pubDate>Thu, 30 Aug 2007 16:22:50 +0000</pubDate> <guid
isPermaLink="false">http://beta.ariejan.net/?p=76#comment-188</guid> <description>brandon wrote: &lt;blockquote&gt;... Having a slight issue with the _path that is being created.  I have a Client that has_many Matters.  On my show page for my client I built in a form for adding new matters.  The form has:  matters_path(@client, @matter)) do &#124;f&#124; %&gt; which builds the url /matters/ rather than /clients/1/matters/ which is what I need for the proper save.  Any advice?
&lt;/blockquote&gt;I have been working on this same issue today the solution I found was
&lt;code&gt;
url_for([@cient.matter, @matter])  do &#124;f&#124; -%&gt;
&lt;/code&gt;
This generates the expected post URL /client/:client_id/matters so the controller can user the params[client_id] to scope the new matter to the correct client!hope this helps</description> <content:encoded><![CDATA[<p>brandon wrote:<br
/><blockquote>&#8230; Having a slight issue with the _path that is being created.  I have a Client that has_many Matters.  On my show page for my client I built in a form for adding new matters.  The form has:  matters_path(@client, @matter)) do |f| %&gt; which builds the url /matters/ rather than /clients/1/matters/ which is what I need for the proper save.  Any advice?</p></blockquote><p>I have been working on this same issue today the solution I found was<br
/> <code><br
/> url_for([@cient.matter, @matter])  do |f| -%&gt;<br
/> </code><br
/> This generates the expected post URL /client/:client_id/matters so the controller can user the params[client_id] to scope the new matter to the correct client!</p><p>hope this helps</p> ]]></content:encoded> </item> <item><title>By: Ben Wyrosdick</title><link>http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/comment-page-1/#comment-184</link> <dc:creator>Ben Wyrosdick</dc:creator> <pubDate>Tue, 22 May 2007 18:47:57 +0000</pubDate> <guid
isPermaLink="false">http://beta.ariejan.net/?p=76#comment-184</guid> <description>I guess the new stuff in trunk is to address problems like joost was having.  that way it separates the calls to all recipes ingredients_path &amp; recipe_ingredients_path(@recipe).</description> <content:encoded><![CDATA[<p>I guess the new stuff in trunk is to address problems like joost was having.  that way it separates the calls to all recipes ingredients_path &amp; recipe_ingredients_path(@recipe).</p> ]]></content:encoded> </item> <item><title>By: Shane Vitarana</title><link>http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/comment-page-1/#comment-181</link> <dc:creator>Shane Vitarana</dc:creator> <pubDate>Wed, 09 May 2007 19:04:43 +0000</pubDate> <guid
isPermaLink="false">http://beta.ariejan.net/?p=76#comment-181</guid> <description>Just wanted to mention that in the latest Rails trunk, you have to prefix a nested resource with its parent.  So ingredient_path(@recipe, @ingredient) will become recipe_ingredient_path(@recipe, @ingredient).</description> <content:encoded><![CDATA[<p>Just wanted to mention that in the latest Rails trunk, you have to prefix a nested resource with its parent.  So ingredient_path(@recipe, @ingredient) will become recipe_ingredient_path(@recipe, @ingredient).</p> ]]></content:encoded> </item> <item><title>By: Thomas Ritz &#187; Blog Archive &#187; Rails REST routes explained</title><link>http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/comment-page-1/#comment-182</link> <dc:creator>Thomas Ritz &#187; Blog Archive &#187; Rails REST routes explained</dc:creator> <pubDate>Sat, 21 Apr 2007 11:40:13 +0000</pubDate> <guid
isPermaLink="false">http://beta.ariejan.net/?p=76#comment-182</guid> <description>[...] has another post that concentrates on nested [...]</description> <content:encoded><![CDATA[<p>[...] has another post that concentrates on nested [...]</p> ]]></content:encoded> </item> <item><title>By: Ariejan</title><link>http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/comment-page-1/#comment-180</link> <dc:creator>Ariejan</dc:creator> <pubDate>Mon, 19 Mar 2007 22:17:12 +0000</pubDate> <guid
isPermaLink="false">http://beta.ariejan.net/?p=76#comment-180</guid> <description>@joost: Just add map.resoureces :ingredients to your config/routes.rbYou&#039;ll have ingredients twice there, but that&#039;s no problem at all. I was amazed by this too when I found out, but it works perfectly.</description> <content:encoded><![CDATA[<p>@joost: Just add map.resoureces :ingredients to your config/routes.rb</p><p>You&#8217;ll have ingredients twice there, but that&#8217;s no problem at all. I was amazed by this too when I found out, but it works perfectly.</p> ]]></content:encoded> </item> <item><title>By: joost baaij</title><link>http://ariejan.net/2007/01/23/rails-nested-resource-scaffold/comment-page-1/#comment-178</link> <dc:creator>joost baaij</dc:creator> <pubDate>Mon, 19 Mar 2007 12:11:55 +0000</pubDate> <guid
isPermaLink="false">http://beta.ariejan.net/?p=76#comment-178</guid> <description>I agree that nested routes are a thing of beauty, but once nested it seems impossible to &#039;un-nest&#039; a resource.What I am getting at is that I would like toa) show the ingredients for one recipe. this works fine.b) show a list of ingredients covering all recipies.This latter doesn&#039;t seem possible. Logically, the url would become /ingredients but these can only exist inside recipes (giving /recipes/2/ingredients).Do you know a way to have both? List all ingredients for one recipe AND list them all for all recipes?</description> <content:encoded><![CDATA[<p>I agree that nested routes are a thing of beauty, but once nested it seems impossible to &#8216;un-nest&#8217; a resource.</p><p>What I am getting at is that I would like to</p><p>a) show the ingredients for one recipe. this works fine.</p><p>b) show a list of ingredients covering all recipies.</p><p>This latter doesn&#8217;t seem possible. Logically, the url would become /ingredients but these can only exist inside recipes (giving /recipes/2/ingredients).</p><p>Do you know a way to have both? List all ingredients for one recipe AND list them all for all recipes?</p> ]]></content:encoded> </item> </channel> </rss>
<!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached (user agent is rejected)

Served from: starbuck.ariejan.net @ 2010-03-13 12:38:05 -->