Hi! When I started my project I generated some scaffolding for my frontend. Now I want to generate some standard scaffolding again, in my /admin area. If I simply do rails generate scaffold admin/posts I get a migration for a table and so on. I want to use the tables and models and just generate the standard views and a controller. Can I do that somehow? Best Regards Linus -- 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.
On 03/24/2011 07:53 AM, Linus Pettersson wrote:> Hi! > > When I started my project I generated some scaffolding for my > frontend. Now I want to generate some standard scaffolding again, in > my /admin area. > > If I simply do rails generate scaffold admin/posts > I get a migration for a table and so on. I want to use the tables and > models and just generate the standard views and a controller. > > Can I do that somehow? > > Best Regards > Linus >You can just delete the generated code you do not want to use. If the migration is not needed just get rid of it and that goes for any other pieces that the generator generates. Its your code, the generator is just there to do some of the easy parts for you. Norm -- 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.
Hey bros, Use devise gem to make it simpler and overlay you admin controller. Else, try practice on hardcoding. Diving on slim controller fat model design. Scaffold will make you lazy after all. Thanks! Andre On Mar 24, 2011, at 10:53 PM, Linus Pettersson <linus.pettersson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi! > > When I started my project I generated some scaffolding for my > frontend. Now I want to generate some standard scaffolding again, in > my /admin area. > > If I simply do rails generate scaffold admin/posts > I get a migration for a table and so on. I want to use the tables and > models and just generate the standard views and a controller. > > Can I do that somehow? > > Best Regards > Linus > > -- > 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. >-- 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.
On 24 March 2011 14:53, Linus Pettersson <linus.pettersson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi! > > When I started my project I generated some scaffolding for my > frontend. Now I want to generate some standard scaffolding again, in > my /admin area. > > If I simply do rails generate scaffold admin/posts > I get a migration for a table and so on. I want to use the tables and > models and just generate the standard views and a controller.Run the scaffold generator then just remove any files you do not need (migration, model and so on). Make sure your source has been committed to your source control system (git or whatever) first so that if the generator overwrites any files you did not intend that you can recover the original. Colin -- 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.