SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Scaffolding

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Scaffolding

    I was following another tutorial online that suggested I experiment with scaffolding, which I did to start building my new app. However after rereading the early chapters of Simply Rails 2, seems this wasn't the right way to go.

    Do I have to scrap everything I've done so far and start over? Or can I continue and just modify the files accordingly as I progress my app?

  2. #2
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Rails generators just create the necessary text files, with the script entries required to do the basic job. There is nothing to stop you modifying this after they have been created. In fact, you are most likely to do so, as the standard set will get you started, but it unlikely to do all you want unless you have very basic requirements.

    However, you can also undo a generate by using the 'destroy' option rather than the 'generate'. So
    Code:
    # Create a model call Ball
    ruby script/generate model Ball
    
    # Undo the generate
    ruby script/destroy model Ball
    Have a look at this:
    http://thinkrefresh.com/posts/6-rails-101-generators

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Glad I don't have to start over. And great screencast too, thanks for the link.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •