Class: ActionDispatch::Routing::Mapper
- Inherits:
-
Object
- Object
- ActionDispatch::Routing::Mapper
- Defined in:
- lib/bigbluebutton_rails/rails/routes.rb
Instance Method Summary collapse
-
#bigbluebutton_routes(*params) ⇒ Object
Helper to define routes for bigbluebutton_rails.
Instance Method Details
#bigbluebutton_routes(*params) ⇒ Object
Helper to define routes for bigbluebutton_rails.
Avaliable options
:default
: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.
: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:
: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.
:room_matchers
You can, for example, create routes associated with users:
resources :users do
: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" }
77 78 79 80 |
# File 'lib/bigbluebutton_rails/rails/routes.rb', line 77 def (*params) = params. send("bigbluebutton_routes_#{params[0].to_s}", ) end |