Class: Bigbluebutton::ServersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Bigbluebutton::ServersController
- Defined in:
- app/controllers/bigbluebutton/servers_controller.rb
Instance Method Summary collapse
- #activity ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #rooms ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#activity ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 23 def activity error = false begin @server.fetch_meetings @server.meetings.each do |meeting| meeting.fetch_meeting_info end rescue BigBlueButton::BigBlueButtonException => e error = true = e.to_s end # update_list works only for html if params[:update_list] && (params[:format].nil? || params[:format].to_s == "html") render :partial => 'activity_list', :locals => { :server => @server } return end respond_with @server.meetings do |format| # we return/render the fetched meetings even in case of error # but we set the error message in the response if error flash[:error] = format.html { render :activity } format.json { array = @server.meetings array.insert(0, { :message => }) render :json => array, :status => :error } else format.html format.json end end end |
#create ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 59 def create @server = BigbluebuttonServer.new(params[:bigbluebutton_server]) respond_with @server do |format| if @server.save format.html { = t('bigbluebutton_rails.servers.notice.create.success') redirect_to(@server, :notice => ) } format.json { render :json => @server, :status => :created } else format.html { render :new } format.json { render :json => @server.errors., :status => :unprocessable_entity } end end end |
#destroy ⇒ Object
91 92 93 94 95 96 97 98 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 91 def destroy @server.destroy respond_with do |format| format.html { redirect_to() } format.json { head :ok } end end |
#edit ⇒ Object
19 20 21 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 19 def edit respond_with(@server) end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 7 def index respond_with(@servers = BigbluebuttonServer.all) end |
#new ⇒ Object
15 16 17 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 15 def new respond_with(@server = BigbluebuttonServer.new) end |
#rooms ⇒ Object
100 101 102 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 100 def rooms respond_with(@rooms = @server.rooms) end |
#show ⇒ Object
11 12 13 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 11 def show respond_with(@server) end |
#update ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 76 def update respond_with @server do |format| if @server.update_attributes(params[:bigbluebutton_server]) format.html { = t('bigbluebutton_rails.servers.notice.update.success') redirect_to(@server, :notice => ) } format.json { head :ok } else format.html { render :edit } format.json { render :json => @server.errors., :status => :unprocessable_entity } end end end |