I’ve seen guides for Rspec that say to use rspec_model script, but in
Rails 3 you don’t have the script folder, and the only Rspec generator
that I have is rspec:install.
The other way is generate them automatically when scaffolding, but I
already have the model, controller and view files created =/
I’ve seen guides for Rspec that say to use rspec_model script, but in
Rails 3 you don’t have the script folder, and the only Rspec generator
that I have is rspec:install.
The other way is generate them automatically when scaffolding, but I
already have the model, controller and view files created =/
rails generate model my_model_that_already_exists --skip-migration
It will ask you if you want to overwrite the existing model file. Say
no.
Well, calling scaffold with flag seems to do the trick. The only con is
that I have to say no for each file, since Ynaqdh doesn’t have a “no to
all” option =/
Edit:
Found ya’!
scaffold -s Model_name
So it skip files that already exists ^^
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.