Rails controller generator

Because scaffolding isn’t the answer to everything, i made a personal generator that churns out some CRUD actions with the RSpec tests that are just the way i like them.

Posted here mainly for reference by future-me but anyone else is welcome to use them too.

Generate Rails controller code

I find it’s particularly amusing if you enter ‘cake’ as the model name. it should look up all cakes in the database. It should not break if no cakes are found. It should attempt to create a new cake.

PS. I decided to do this tonight in anticipation of creating four models with controllers at work tomorrow! Yay for reducing an hour or more of tedious work into a few minutes! :)

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s