I've got a test task for my first programming job application. It includes creating an admin page for managing math test questions, the only requirements being implementations with standard Rails means and the ability to create/modify/delete questions. So is scaffolding considered a totally bad practice in Rails, or is it suitable for such a basic task?
I have been working with Rails since 10 years and I believe I can count the number I used the scaffold command with the fingers of one or at maximum two hands.
As you pointed out, scaffolds tend to generate a lot of unnecessary code. Moreover, the more the layout of your application is customized, the more changes you will have to make to the generated code.
At some point it will become evident that it takes less time to write the code on your own rather than using the scaffold command and then spend most of your time removing unnecessary tags and code.
I generally use the model
command to create a model when required, then I write my controllers manually. It's also easier to follow a test-driven approach because you will incrementally write your tests along with your code without the risk of starting with a bunch of untested and unnecessary code.
Whether it's appropriate for a test, that's subjective. I would probably never ask it during an interview because it feels completely useless in practice, as my candidate will likely never use it. I prefer that someones shows me knowledge of Ruby and perhaps available Rails commands, as being able to type a scaffold command on a console to generate files isn't such fundamental knowledge.