Pokkai Dokkai
2007-Dec-01 09:10 UTC
how to append some action into already available controller?
how to append some action into already available controller with corresponding views (*.rhtml) .for example ruby/script generate controller admin action1 action2.... here admin is already available controller with some action now ,what i want is the new actions(action1 action2....) should be append in admin_controller.rb and corresponding *.rhtml files (action1.rhtml,action2.rhtml...) should be created in app/views/admin/*. any idea ? -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Dec-01 11:37 UTC
Re: how to append some action into already available controller?
On Dec 1, 9:10 am, Pokkai Dokkai <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> how to append some action into already available controller with > corresponding views (*.rhtml) .for example >What''s wrong with just creating those files/methods by hand ? Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Pokkai Dokkai
2007-Dec-02 05:34 UTC
Re: how to append some action into already available control
Frederick Cheung wrote:> On Dec 1, 9:10 am, Pokkai Dokkai <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> how to append some action into already available controller with >> corresponding views (*.rhtml) .for example >> > > What''s wrong with just creating those files/methods by hand ? > > Fredi thing the main advanstage in Rails framework compare than others is very speed and easy implementation. actually in some situation i want to create more than one public definition(method) in an existing controller . in my projects there are lots of controllers (more than 300) for example if i want to create 5 methods with corresponding views in a controller than ,if i do like this (ofcourse below is wrong) than my speed is 5 to 10 times fater than manual creating....>ruby script/generate controller [-append] contro met1 met2 met3 met4 met5and one thing i ask ,why the rails developers should not add this append capability in controller generator ? -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Dec-02 10:39 UTC
Re: how to append some action into already available control
On 2 Dec 2007, at 05:34, Pokkai Dokkai wrote:> > Frederick Cheung wrote: >> On Dec 1, 9:10 am, Pokkai Dokkai <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> >> wrote: >>> how to append some action into already available controller with >>> corresponding views (*.rhtml) .for example >>> >> >> What''s wrong with just creating those files/methods by hand ? >> >> Fred > > i thing the main advanstage in Rails framework compare than others is > very speed and easy implementation. > > actually in some situation i want to create more than one public > definition(method) in an existing controller . > > in my projects there are lots of controllers (more than 300) > > for example if i want to create 5 methods with corresponding views > in a > controller than ,if i do like this (ofcourse below is wrong) than my > speed is 5 to 10 times fater than manual creating.... > >> ruby script/generate controller [-append] contro met1 met2 met3 >> met4 met5 >While script/generate controller is a useful starting point (especially when you''re not quite sure what the naming conventions are, what files go where etc...) in my experience unless the methods and views were completely empty the bulk of the effort is in writing them and the time spent actually creating the files is rather negligible.> > and one thing i ask ,why the rails developers should not add this > append > capability in controller generator ?The generators in general tend to create new files rather than edit them. Off the top of my head I''d say that''s because it''s a lot easier to add things then it is to edit existing things. That said if you can find a way to make this all work nicely then you can always submit a patch. Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---