Why do Ruby on Rails professionals NOT use Scaffolding?

后端 未结 8 1205
梦毁少年i
梦毁少年i 2020-12-04 09:59

I read sometimes from people that seem to be working with rails since longer, that one important lesson they learnt would be \"Don\'t use scaffolding\". Also on irc I read c

相关标签:
8条回答
  • 2020-12-04 10:21

    I am professional Rails developer and I use scaffolding all the time, in fact I can make a pretty decent argument that reproducibility and predictability of scaffolding can make the whole process of learning rails and using rails easier.

    The approach we use is to always start with scaffolding and then as time goes along and we see patterns customise the scaffolding for the project.

    This approach means that we have an approach when we learn we bake knowledge back into the project and when we find issues we fix them in one place and all subsequent uses of the scaffold have that learning instead of constantly having to explain, justify and educate different developers at different skill levels.

    In my experience the biggest issue with rails is its greatest strength! It is the malleability of a rails project is what causes it to be hard to maintain. Lots of ways to achieve the same-thing which is not wrong but does make it hard to pick up from somebody else who has started the project.

    Is our approach fUN , debatable! Is it reproducible, effective, efficient while leaning on rails instead of fighting it , 100% yes!

    0 讨论(0)
  • 2020-12-04 10:22

    I don't use scaffolding for two reasons:

    • Rails scaffolding puts everything in a html tables - I don't like that
    • I prefer to use rails_admin gem for my admin pages so there is no need for 90% of the scaffold code

    Your xml concerns are not the reason why people advise against using scaffolding. I don't bother with XML versions of my pages as it doubles the number of routes your app must generate, which in turn increases the overheads a little...

    0 讨论(0)
提交回复
热议问题