I am trying to setup user registration. I have been recommended not to use scaffold.
So far I have run this command to generate model for all profile information:
rails generate model User name email birthday:date zip_code time_zone sexuality career education religion politics children height does_user_smoke does_user_drink about_me:text career
I want the required sign up information from when a user first visits the website to be name, email, birthday, zip code, and password. I am not sure what the next step is. As far as building the page to have the users sign up. I know I have to edit app/views/users/new.html.erb. When I did the tutorials I ran scaffold which did the work for me, but now I have been told by several people to not user scaffold and just do everything yourself. But I haven’t read a tutorial, nor can I find any examples on the internet that will walk me through building a user register page in rails.
So I don’t know if I should go back to using scaffold or hopefully someone can point me in the right direction with starting on the user register page.
Yes, there are tutorials about authentication. I personally like Ryan Bates’s screencast authentication from scratch. That tutorial should include everything you need.
As for the scaffolding, I think it really depends on what you’re trying to achieve here. All scaffolding does is create the basic CRUD (create, read, update, delete) operations on a model for you, including controller, views and tests. Since you needed those views, for example, you could have used that. And prewritten tests are awesome.
However, in this case I would just go with the screencast and not use scaffolding. Scaffolding is nice for any model that doesn’t need anything fancy like authentication, but only the basic CRUD operations.