I''m sure we all find out that after some time, out admin pages look the same, and have roughly the same code in their controllers. I already have been able to dramatically dry out my admin/controllers code by creating a generic admins_controller, and subclass it. But what about the views? They are similar, but I can''t find a way to use same views for my admin controllers. How do you handle that? Plugin? -- Posted via http://www.ruby-forum.com/.
Fernando Perez wrote:> I''m sure we all find out that after some time, out admin pages look the > same, and have roughly the same code in their controllers. > > I already have been able to dramatically dry out my admin/controllers > code by creating a generic admins_controller, and subclass it. But what > about the views? They are similar, but I can''t find a way to use same > views for my admin controllers. > > How do you handle that? Plugin?Hi, If you don''t overload a method, you could specifically call render :template => ''admin/action'', so that it will render a set template. If you overload a method in a subclass, you could do the same thing. Hope this helps :) // Wouter -- Posted via http://www.ruby-forum.com/.
Fernando Perez wrote:> I''m sure we all find out that after some time, out admin pages look the > same, and have roughly the same code in their controllers. > > I already have been able to dramatically dry out my admin/controllers > code by creating a generic admins_controller, and subclass it. But what > about the views? They are similar, but I can''t find a way to use same > views for my admin controllers. > > How do you handle that? Plugin?ActiveScaffold? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
There''s an interesting Railscast on the subject: http://railscasts.com/episodes/19-where-administration-goes It''s a different approach, but might work for what you''re doing. On Sun, Oct 25, 2009 at 10:35 AM, Marnen Laibow-Koser < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Fernando Perez wrote: > > I''m sure we all find out that after some time, out admin pages look the > > same, and have roughly the same code in their controllers. > > > > I already have been able to dramatically dry out my admin/controllers > > code by creating a generic admins_controller, and subclass it. But what > > about the views? They are similar, but I can''t find a way to use same > > views for my admin controllers. > > > > How do you handle that? Plugin? > > ActiveScaffold? > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ActiveScaffold sounds interesting. Any feedback? I see it''s well maintained, it''s a good selling point for me. -- Posted via http://www.ruby-forum.com/.
Fernando Perez wrote:> ActiveScaffold sounds interesting. Any feedback? I see it''s well > maintained, it''s a good selling point for me.I mostly like it. It''s not perfect, but it''s quick and easy. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.