RailsConf Panel: Overcoming Scaffolding Addiction with Amy Hoy

A funny panel on how to get past scaffolding.

!http://static.flickr.com/48/173439106_5b3fe1c6d7_m.jpg!:http://flickr.com/photos/kastner/173439106/

How do I do x,y and z with scaffolding? The answer is STOP, and learn rails. Scaffolding is a rusty spoon, not a swiss army knife.

A slow start, but Amy warmed up very quickly and her slides were VERY VERY funny.

Scaffolding is also WAY overbloated. 10+ files without tests.

It is also brain-numbing. She’s disagreeing with Dave Thomases’ idea of MORE scaffolding, she thinks that it leads to bad coding.

What you need is “Cold-turkey” from the scaffolding. She recommends that you start from scratch.

kittens:
* create
* view
* edit
* feed
* put to sleep (not implemented for good reason)

jars:
* create
* edit
* view

@script/generate controller kittens create view edit feed put_to_sleep@

@script/generate model kitten –skip-migration@
@script/generate model jar –skip-migration@

Her panel was VERY basic, but VERY VERY clear and great. Her book is gonna rock.

She likes to make data before anything therefore her create method is first. She overloads the create method by looking for a variable that was posted THEN saving it.
After this step, she goes and edits the view. With the view, she’s using start_form_tag – why not form_for?
@<%= debug(params) %>@ inside the .rhtml to see what’s going on.

She then went on to show how to make a whole association. Very good!

h3. more fun with forms

* Partials
sub templates use an underscore @_kitten_form.rhtml@
* Helpers

h3. Misc.

* before_filter
* layouts partials and views

“www.slash7.com”:http://www.slash7.com/