1

When using scaffolding in Rails, you end up with placeholder .css/.scss and .js/.coffee files under the assets directories. Unless I am adding something to one they will stay empty.

I would assume the assets pipeline would ignore the empty files when compiling, but is there any reason I wouldn't just delete them all?

port5432
  • 5,889
  • 10
  • 60
  • 97

1 Answers1

2

rails generate scaffold is just a helper. It simply generated everything that could possibly be useful to you.

Sure you can delete all unneeded files. You could also delete a model or controller after it has been created if you don't need it anymore.

Benjamin M
  • 23,599
  • 32
  • 121
  • 201
  • I assume it would be best to generate a migration to drop any tables, something like: rails destroy model my_models ? – port5432 Feb 23 '13 at 14:14
  • You have to distinguish: **1.** If you've used the rails generator to generate a model (and a migration) - this gets also done by using scaffold - then you also have to create a new migration which drops the tables. So you'd have migration1 which creates the table and migration2 which drops it afterwards. **2.** If you've created your database table without migration (for example using phpMyAdmin or plain SQL in you console), then you should should drop the table by hand, without using migrations. **Also have a look here:** http://stackoverflow.com/a/7106032/1321564 – Benjamin M Feb 23 '13 at 16:40