<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>e168f08 - Latest Comments in Slightly updated version of the &amp;#8220;crud&amp;#8221; app on downloads page</title><link>http://e168f08.disqus.com/</link><description></description><atom:link href="https://e168f08.disqus.com/slightly_updated_version_of_the_8220crud8221_app_on_downloads_page/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 13 Nov 2009 18:03:54 -0000</lastBuildDate><item><title>Re: Slightly updated version of the &amp;#8220;crud&amp;#8221; app on downloads page</title><link>http://e168f08.plugh.org/rails/slightly-updated-version-of-the-crud-app-on-downloads-page/#comment-22955107</link><description>&lt;p&gt;Wow thanks for this really useful update. I was using the old version, but I will download the new one of course. Oh my I have spotted that this pose is written over a year ago only now. What an interesting thing - it is actually written a year ago, on 14 november 2008 :)) Nice one. However I will definitely download this application and try it out. Thanks one more time for your efforts.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mobile application development</dc:creator><pubDate>Fri, 13 Nov 2009 18:03:54 -0000</pubDate></item><item><title>Re: Slightly updated version of the &amp;#8220;crud&amp;#8221; app on downloads page</title><link>http://e168f08.plugh.org/rails/slightly-updated-version-of-the-crud-app-on-downloads-page/#comment-21666061</link><description>&lt;p&gt;-&amp;gt; @student = &lt;a href="http://Student.new" rel="nofollow noopener" target="_blank" title="Student.new"&gt;Student.new&lt;/a&gt;(params[:student])  how are you getting parameters though ?&lt;br&gt;__________________________________________&lt;br&gt;My &lt;a href="http://www.sanatatesexuala.ro/produs.php?nume=b_v-rx_black" rel="nofollow noopener" target="_blank" title="http://www.sanatatesexuala.ro/produs.php?nume=b_v-rx_black"&gt;erectie&lt;/a&gt; site.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ouadamantite</dc:creator><pubDate>Mon, 02 Nov 2009 09:26:00 -0000</pubDate></item><item><title>Re: Slightly updated version of the &amp;#8220;crud&amp;#8221; app on downloads page</title><link>http://e168f08.plugh.org/rails/slightly-updated-version-of-the-crud-app-on-downloads-page/#comment-19738843</link><description>&lt;p&gt;thanks for the heads up, this really helped me a lot..&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">picture cataloging software</dc:creator><pubDate>Sat, 10 Oct 2009 10:50:41 -0000</pubDate></item><item><title>Re: Slightly updated version of the &amp;#8220;crud&amp;#8221; app on downloads page</title><link>http://e168f08.plugh.org/rails/slightly-updated-version-of-the-crud-app-on-downloads-page/#comment-15479803</link><description>&lt;p&gt;It seems that your coding is very logical and coherent, but it doesn't work as it should... Why is that? &lt;br&gt;_______________________________&lt;br&gt;&lt;a href="http://www.mandarina-learning.com/53/the-benefits-of-online-education/" rel="nofollow noopener" target="_blank" title="http://www.mandarina-learning.com/53/the-benefits-of-online-education/"&gt;Online Degrees&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">DoctorPsi</dc:creator><pubDate>Thu, 27 Aug 2009 14:07:39 -0000</pubDate></item><item><title>Re: Slightly updated version of the &amp;#8220;crud&amp;#8221; app on downloads page</title><link>http://e168f08.plugh.org/rails/slightly-updated-version-of-the-crud-app-on-downloads-page/#comment-3771055</link><description>&lt;p&gt;Hey, one more thing following up my earlier reply:&lt;/p&gt;&lt;p&gt;This is probably a good case for a private method which both new and create would leverage -- that private method would load up @sections for the drop-down.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Fri, 14 Nov 2008 10:01:18 -0000</pubDate></item><item><title>Re: Slightly updated version of the &amp;#8220;crud&amp;#8221; app on downloads page</title><link>http://e168f08.plugh.org/rails/slightly-updated-version-of-the-crud-app-on-downloads-page/#comment-3769147</link><description>&lt;p&gt;You can do it either way -- there is no really standard way to do this.&lt;/p&gt;&lt;p&gt;Both solutions are problematic.&lt;/p&gt;&lt;p&gt;If you create a new set of @sections in create, then you're not DRY. If you do "@student ||= &lt;a href="http://Student.new" rel="nofollow noopener" target="_blank" title="Student.new"&gt;Student.new&lt;/a&gt;" and call the "new' method, then your "new" method isn't really create a NEW @student in all cases, so if you think that the method name should be explanatory, then you've given up on that. Which is fine if that's what you want. I have done it both ways myself.&lt;/p&gt;&lt;p&gt;In a more complicated strategy, you would "dry" up the entire new/create/edit/update cycle -- but that would require more trickery than we need right now. For pedagogical purposes -- and in this particular case -- I think the direct approach explains pretty clearly how when you get to that form, all of the data it needs must be in place.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Fri, 14 Nov 2008 07:31:38 -0000</pubDate></item><item><title>Re: Slightly updated version of the &amp;#8220;crud&amp;#8221; app on downloads page</title><link>http://e168f08.plugh.org/rails/slightly-updated-version-of-the-crud-app-on-downloads-page/#comment-3766621</link><description>&lt;p&gt;I'm unhappy about this fix, because you're repeating yourself, and now two different methods have information about what the "new" view expects for instance variables, making the code a little fragile.  I would suggest, instead of the new "#important line!", a call to the new METHOD, to pick up the necessary data, making the create method look like&lt;/p&gt;&lt;p&gt;def create  &lt;br&gt;  @student = &lt;a href="http://Student.new" rel="nofollow noopener" target="_blank" title="Student.new"&gt;Student.new&lt;/a&gt;(params[:student])  &lt;br&gt;  if @student.save  &lt;br&gt;    redirect_to :action =&amp;gt; :index  &lt;br&gt;    flash[:notice] = 'Student was successfully created.'  &lt;br&gt;  else  &lt;br&gt;    new     #set up instance variables expected by the new view&lt;br&gt;    render :action =&amp;gt; :new  &lt;br&gt;  end  &lt;br&gt;end&lt;/p&gt;&lt;p&gt;and, understanding that the reason we're doing this render instead of just redirecting to new is to preserve the value of @student, we could rewrite the second line of the new method as&lt;/p&gt;&lt;p&gt;@student ||= &lt;a href="http://Student.new" rel="nofollow noopener" target="_blank" title="Student.new"&gt;Student.new&lt;/a&gt;&lt;/p&gt;&lt;p&gt;to prevent overwriting the value, if it's there.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Morris</dc:creator><pubDate>Fri, 14 Nov 2008 00:05:49 -0000</pubDate></item></channel></rss>