Ezequiel Schwartzman
2011-Aug-22 19:18 UTC
How do I generate the Rspec file for an already existing model in Rails 3?
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 =/ -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
David Chelimsky
2011-Aug-22 19:30 UTC
Re: How do I generate the Rspec file for an already existing model in Rails 3?
On Aug 22, 2:18 pm, Ezequiel Schwartzman <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> 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. HTH, David> > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ezequiel Schwartzman
2011-Aug-22 19:36 UTC
Re: How do I generate the Rspec file for an already existing model in Rails 3?
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 =/ -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.