I have a controller: vendor/plugins/buoy_report/lib/app/controllers/ buoy_station_controller.rb class BuoyStationController < ActionController::Base def index render :text => ''buoy test'' end end when I try the url for rails 2.3.11: http://localhost:3000/buoy_station/index I get: Routing Error No route matches "/buoy_station/index" with {:method=>:get} -- 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.
Hi jedrin first of all, you should make sure that this route is really existing(you can type rake routes | grep "buoy_station"). secondly, you have to add the following configurations to vendor/ plugins/buoy_report/lib/buoy_station.rb : %w{ models controllers helpers }.each do |dir| path = File.join(File.dirname(__FILE__), ''app'', dir) $LOAD_PATH << path ActiveSupport::Dependencies.load_paths << path ActiveSupport::Dependencies.load_once_paths.delete(path) end This is important to add your plugin files to the load path and make them appear just like files in the main app directory. i hope that this helps you for more information in how to make a plugin, this link could be helpful: http://guides.rubyonrails.org/v2.3.8/plugins.html On May 26, 7:25 am, Jedrin <jrubia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a controller: > > vendor/plugins/buoy_report/lib/app/controllers/ > buoy_station_controller.rb > > class BuoyStationController < ActionController::Base > > def index > render :text => ''buoy test'' > end > > end > > when I try the url for rails 2.3.11: > > http://localhost:3000/buoy_station/index > > I get: > > Routing Error > No route matches "/buoy_station/index" with {:method=>:get}-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks, I seem to remember some of that, it''s been awhile. I put that code in my plugin that you posted, I am still having the same problem Anyway, ''rake routes'' just shows these. /:controller/:action/:id /:controller/:action/:id(.:format) -- 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 May 26, 7:25 am, Jedrin <jrubia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a controller: > > vendor/plugins/buoy_report/lib/app/controllers/ > buoy_station_controller.rbThat should probably be vendor/plugins/buoy_report/app/controllers/ buoy_station_controller.rb if you want it to get picked up automatically by rails Fred> > class BuoyStationController < ActionController::Base > > def index > render :text => ''buoy test'' > end > > end > > when I try the url for rails 2.3.11: > > http://localhost:3000/buoy_station/index > > I get: > > Routing Error > No route matches "/buoy_station/index" with {:method=>:get}-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks alot. I went through this whole thing like below, was that unnecessary ? module BuoyReport #:nodoc: module Routing #:nodoc: module MapperExtensions def buoy_reports @set.add_route("/buoy_report", {:controller => "buoy_reports", :action => "index"}) end end end end ActionController::Routing::RouteSet::Mapper.send :include, BuoyReport::Routing::MapperExtensions -- 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.
sorry, i maked a mistake, you should put the configurations in vendor/ plugins/buoy_report/lib/buoy_report.rb instead of: vendor/plugins/buoy_report/lib/buoy_station.rb concerning route , why don''t put map.resources :buoy_station in the main routes file? On May 26, 2:16 pm, Jedrin <jrubia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks alot. > > I went through this whole thing like below, was that unnecessary ? > > module BuoyReport #:nodoc: > module Routing #:nodoc: > module MapperExtensions > def buoy_reports > @set.add_route("/buoy_report", {:controller => > "buoy_reports", :action => "index"}) > end > end > end > end > > ActionController::Routing::RouteSet::Mapper.send :include, > BuoyReport::Routing::MapperExtensions-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, I have seen your posts suggesting to load paths for all controllers/ models/views from plugin. I used the following command : %w{ models controllers }.each do |dir| path = File.join(File.dirname(__FILE__), ''app'', dir) $LOAD_PATH << path puts path puts "yeyeyeyyeyeye" ActiveSupport::Dependencies.load_paths << path ActiveSupport::Dependencies.load_once_paths.delete(path) but getting following error : undefined method `load_paths'' for ActiveSupport::Dependencies:Module (NoMethodError) I know sometime back you also got the same error. Please let me know what was the root cause. Thanks in advance. Jony Malhotra On May 26, 7:42 pm, heithem nouira <heithem.nou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> sorry, i maked a mistake, you should put the configurations in vendor/ > plugins/buoy_report/lib/buoy_report.rb instead of: > vendor/plugins/buoy_report/lib/buoy_station.rb > > concerning route , why don''t put map.resources :buoy_station in the > main routes file? > > On May 26, 2:16 pm, Jedrin <jrubia...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Thanks alot. > > > I went through this whole thing like below, was that unnecessary ? > > > module BuoyReport #:nodoc: > > module Routing #:nodoc: > > module MapperExtensions > > def buoy_reports > > @set.add_route("/buoy_report", {:controller => > > "buoy_reports", :action => "index"}) > > end > > end > > end > > end > > > ActionController::Routing::RouteSet::Mapper.send :include, > > BuoyReport::Routing::MapperExtensions > >-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.