Say for instance, if I have a class that computes PI, where would the best place to locate this class so that its accessible by the controllers and helpers? What if I wanted to make this generic class accessible to multiple RoR projects? TIA. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Make it a plugin if it''s mainly for use in Rails projects... if it''s generally applicable to any Ruby project, you might want to make it a Gem. http://wiki.rubyonrails.com/rails/pages/Plugins http://docs.rubygems.org/ - james On 11/25/05, Jim Jones <jjones-lzy1PqPdFF3QT0dZR+AlfA@public.gmane.org> wrote:> > > > Say for instance, if I have a class that computes PI, where would the best > place to locate this class so that its accessible by the controllers and > helpers? What if I wanted to make this generic class accessible to multiple > RoR projects? > > > > TIA. > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
The lib folder is also viable. Remember to include it in your environment. On 11/25/05, James Adam <james.adam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Make it a plugin if it''s mainly for use in Rails projects... if it''s > generally applicable to any Ruby project, you might want to make it a > Gem. > > http://wiki.rubyonrails.com/rails/pages/Plugins > http://docs.rubygems.org/ > > - james > > On 11/25/05, Jim Jones <jjones-lzy1PqPdFF3QT0dZR+AlfA@public.gmane.org> wrote: > > > > > > > > Say for instance, if I have a class that computes PI, where would the best > > place to locate this class so that its accessible by the controllers and > > helpers? What if I wanted to make this generic class accessible to multiple > > RoR projects? > > > > > > > > TIA. > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Is it possible to create a directory somewhere outside of the project and include that directory in the path? -- Posted via http://www.ruby-forum.com/.
Rick wrote:> Is it possible to create a directory somewhere outside of the project > and include that directory in the path?You can sym link it: ls -s reusable_stuff/your_plugin your_rails_app/vendor/plugins/your_plugin - Scott -- Posted via http://www.ruby-forum.com/.