Skip to content

How to: Inherit controllers

daronco edited this page May 16, 2011 · 4 revisions

The process is the same whether you want to inheriting servers or rooms. This page shows an example for both servers an rooms, but you don't necessarily need to do it for both.

At first, create a controller that inherits Bigbluebutton::ServersController. In app/controllers/custom_servers_controller.rb and app/controllers/custom_rooms_controller.rb:

class CustomServersController < Bigbluebutton::ServersController
end
class CustomRoomsController < Bigbluebutton::RoomsController
end

Change your routes.rb to use the new controller:

bigbluebutton_routes :default, :controllers => { :servers => 'custom_servers', :rooms => 'custom_rooms' }

See routes for more information on how to customize your routes.

The views for this controller should be at app/views/custom_servers/, so you need to move BigbluebuttonRails views to this path:

mv app/views/bigbluebutton/servers/ app/views/custom_servers/
mv app/views/bigbluebutton/rooms/ app/views/custom_rooms/

If you don't have the BigbluebuttonRails views in your application yet, you can generate them with:

rails generate bigbluebutton_rails:views
Clone this wiki locally