Scaffold default files are the best practice?

Posted by antpaw on Stack Overflow See other posts from Stack Overflow or by antpaw
Published on 2010-04-10T18:45:53Z Indexed on 2010/04/10 19:33 UTC
Read the original article Hit count: 285

Hey, i have some experience with MVC. but I'm new to rails. I'm using the scaffold command to generate some default files. The model looks clean and nice, but the controller and the views aren't really dry. The contents of new.html.erb and edit.html.erb are almost the same and the methods new/edit and create/update are doing almost the same thing. In other frameworks i've used only one view for updating and creating new entries and also the same method in my controller by setting the id as an optional parameter. Do they use this structure to keep things RESTful (i have not much of a clue about rest :()? Is it the best practice to use this default stuff for crud?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about scaffolding