Buy or Subscribe
You can access this course in just a minute, and support my efforts to rid the world of crappy online courses!
Scaffolding is straightforward, but you'll want to be sure you check out your options:
rails g scaffold --help
I tend to avoid creating files I won't ever use because I hate visual clutter, but do whatever works for you, To that end, I will usually tell the scaffold to skip creating helpers and javascript nonsense:
rails g scaffold user name email:uniq --no-jbuilder --no-helper
Here, I'm telling Rails that our user has a name that's a string (the default) and same with email, but that the email should be unique (it's abbreviated in Ruby for some weird reason).
A note on helpers: they are very useful if you think you're going to create a page that will have some UI "logic" on it. My lesson page that shows videos, for instance, conditionally shows things based on whether someone is logged in and can access the video. That logic should be in a helper, not on your page.
A note on helpers: they are very useful if you think you're going to create a page that will have some UI "logic" on it. My lesson page that shows videos, for instance, conditionally shows things based on whether someone is logged in and can access the video. That logic should be in a helper, not on your page.