class ActionDispatch::Routing::Mapper
Public Instance Methods
# File lib/bigbluebutton_rails/rails/routes.rb, line 82 def bigbluebutton_api_routes(api_scope='/api/conference') scope api_scope do resources :rooms, only: [] do collection do get :index, to: 'bigbluebutton/api/rooms#index' end member do get :running, to: 'bigbluebutton/api/rooms#running' post :join, to: 'bigbluebutton/api/rooms#join' end end end end
Helper to define routes for bigbluebutton_rails.
Avaliable options¶ ↑
bigbluebutton_routes :default bigbluebutton_routes :room_matchers
Default routes¶ ↑
Passing the option :default, it will generate the default routes to access servers, rooms and recordings. The routes generated are the CRUD routes generated by rails to a resource, plus the other available actions for servers and rooms.
bigbluebutton_routes :default
Examples of some routes generated:
bigbluebutton_server GET /bigbluebutton/servers/:id(.:format) { :action=>"show", :controller=>"bigbluebutton/servers" } POST /bigbluebutton/servers/:id(.:format) { :action=>"update", :controller=>"bigbluebutton/servers" } join_bigbluebutton_room GET /bigbluebutton/rooms/:id/join(.:format) { :action=>"join", :controller=>"bigbluebutton/rooms" } running_bigbluebutton_room GET /bigbluebutton/rooms/:id/running(.:format) { :action=>"running", :controller=>"bigbluebutton/rooms" } play_bigbluebutton_recording GET /bigbluebutton/recordings/:id/play(.:format) { :action=>"play", :controller=>"bigbluebutton/recordings" }
The routes point by default to the controllers provided by this gem and they are scoped (namespaced) with 'bigbluebutton'. You can change the namespace with:
bigbluebutton_routes :default, :scope => "webconference"
You can also change the controllers with:
bigbluebutton_routes :default, :controllers => { :servers => "custom_servers", :rooms => "custom_rooms", :recordings => "custom_recordings", :playback_types => "custom_playback_types }
Room matchers¶ ↑
Generates matchers to access a room from a different url or inside another resource. Rooms can belong to users, communities or any other type of “entity” in an aplication. This helper creates routes to the all the actions available in Bigbluebutton::RoomsController.
bigbluebutton_routes :room_matchers
You can, for example, create routes associated with users:
resources :users do bigbluebutton_routes :room_matchers end
Examples of some routes generated:
user_room GET /users/:user_id/room/:id(.:format) { :controller=>"bigbluebutton/rooms", :action=>"show" } user_join_room GET /users/:user_id/room/:id/join(.:format) { :controller=>"bigbluebutton/rooms", :action=>"join" } user_end_room GET /users/:user_id/room/:id/end(.:format) { :controller=>"bigbluebutton/rooms", :action=>"end" } user_invite_room GET /users/:user_id/room/:id/invite(.:format) { :controller=>"bigbluebutton/rooms", :action=>"invite" }
# File lib/bigbluebutton_rails/rails/routes.rb, line 77 def bigbluebutton_routes(*params) options = params.extract_options! send("bigbluebutton_routes_#{params[0].to_s}", options) end