<?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="http://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>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.</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>-&amp;gt; @student = Student.new(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"&gt;erectie&lt;/a&gt; site.
&lt;br&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>thanks for the heads up, this really helped me a lot..</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>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"&gt;Online Degrees&lt;/a&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>Hey, one more thing following up my earlier reply:
&lt;br&gt;
&lt;br&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;</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>You can do it either way -- there is no really standard way to do this.
&lt;br&gt;
&lt;br&gt;Both solutions are problematic.
&lt;br&gt;
&lt;br&gt;If you create a new set of @sections in create, then you're not DRY. If you do "@student ||= Student.new" 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;br&gt;
&lt;br&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;</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>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;br&gt;
&lt;br&gt;def create  
&lt;br&gt;  @student = Student.new(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;br&gt;
&lt;br&gt;
&lt;br&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;br&gt;
&lt;br&gt;@student ||= Student.new
&lt;br&gt;
&lt;br&gt;to prevent overwriting the value, if it's there.</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>
