Re: controller from plugin not working

heithem nouira
Thu, 26 May 2011 10:24:53 -0000

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}