If I call
rails g controller user
multiple times to add actions, is this safe?
e.g. I did ‘rails g controller user index’ but now I want to create more actions?
btw, how can I create all REST based actions automatically?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
yesh, safe. See
rails g scaffoldfor generating REST actions automatically, including the model and views and tests.Note that you can also pass a option
--pretendwhen running the generator so that it shows you what files will be created, but does not actually create the files.