wbsurfver-/E1597aS9LQAvxtiuMwx3w@public.gmane.org
2007-Oct-20 00:26 UTC
where to put code for my own paginator ?
I had to make my own pagination class in SQL Server. What I am wondering is where is a good place to put the code so that every controller and template can have access to it ? Right now I have put it in application.rb, the controller base class. This seems to work well, I did a project last summer where I put stuff in the lib directory. The only problem with that is that if you change any code at all in the lib directory, it seems you have to restart the server or at least if you use webbrick. Anyway, if anyone thinks there is a better choice let me know ... Also, I wish ruby allowed something like /* */ for comment blocks, =begin =end seems kind of verbose ... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
you can make a plugin. it''s surelly the better idea about where to put the code... On Fri, 2007-10-19 at 17:26 -0700, wbsurfver-/E1597aS9LQAvxtiuMwx3w@public.gmane.org wrote:> > I had to make my own pagination class in SQL Server. What I am > wondering is where is a good place to put the code so that every > controller and template can have access to it ? > Right now I have put it in application.rb, the controller base class. > This seems to work well, I did a project last summer where I put stuff > in the lib directory. The only problem with that is that if you change > any code at all in the lib directory, it seems you have to restart the > server or at least if you use webbrick. Anyway, if anyone thinks there > is a better choice let me know ... > > Also, I wish ruby allowed something like /* */ for comment blocks, > =begin =end seems kind of verbose ... > > > >-- Carlos Júnior junior-S4GJ/JUYAA8bCsTw5SJnEQ@public.gmane.org Boa Noite BH - Os melhores momentos da noite +55 31 87635606 --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Placing it in applicaton.rb is a good choice... CCH http://cch4rails.blogspot.com On Oct 20, 8:26 am, "wbsurf...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org" <wbsurf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I had to make my own pagination class in SQL Server. What I am > wondering is where is a good place to put the code so that every > controller and template can have access to it ? > Right now I have put it in application.rb, the controller base class. > This seems to work well, I did a project last summer where I put stuff > in the lib directory. The only problem with that is that if you change > any code at all in the lib directory, it seems you have to restart the > server or at least if you use webbrick. Anyway, if anyone thinks there > is a better choice let me know ... > > Also, I wish ruby allowed something like /* */ for comment blocks, > =begin =end seems kind of verbose ...--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---