Arctus Blog: Rails: Dismantling the Scaffolding http://blog.arctus.co.uk/articles/2007/05/08/rails-dismantling-the-scaffolding en-us 40 Rails: Dismantling the Scaffolding <p>Rails Scaffolding. It&#8217;s one of those features that looks really good the first time you see it &#8211; a &#8216;why didn&#8217;t I think of that?&#8217; kind of feature. However, after a few projects you realise that it&#8217;s not really that useful at all. The time it saves is minimal, and you&#8217;ll inevitably end up writing your own screens for <span class="caps">CRUD</span> anyway.</p> <p>The argument is that scaffolding is there to get you started and that it is so easy to replace it, one screen at a time, that it won&#8217;t get in the way of rounding your application out.</p> <p>I feel that the argument is kind of moot. By getting your code down early you are starting to prepare the way for your final application rather than delaying certain aspects.</p> <p>Besides, how long does it take a Rails developer to create a good, minimal <span class="caps">CRUD</span> screen? About 10 minutes? 5? It certainly doesn&#8217;t take long. The way that forms are built and handled is one of my absolute favourite things in Ruby. It makes me smile everytime I create text_fields in my html and then x.update_attributes(params[:some_model]).</p> <p>The main reason I suggest always rolling your own is that it makes you think about the presentation of the data and that, in turn, makes you think about the way your application is going to be used. It&#8217;s all an important part of the lifecycle. You get to think about how lists are presented &#8211; ordering, paging and the fields that are shown. You have to think about the layout of the forms, and especially the way that you manage data in related models.</p> <p>These are the reasons that I have never found a use for scaffolding in any real-life Rails project.</p> Tue, 08 May 2007 07:50:00 -0400 urn:uuid:47e9012e-8faf-4fcb-b3a0-117f6294d026 adrian@arctus.co.uk (Adrian O'Connor) http://blog.arctus.co.uk/articles/2007/05/08/rails-dismantling-the-scaffolding Ruby on Rails