Class: Bigbluebutton::RecordingsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Bigbluebutton::RecordingsController
- Defined in:
- app/controllers/bigbluebutton/recordings_controller.rb
Instance Method Summary collapse
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #play ⇒ Object
- #publish ⇒ Object
- #show ⇒ Object
- #unpublish ⇒ Object
- #update ⇒ Object
Methods included from BigbluebuttonRails::InternalControllerMethods
Instance Method Details
#destroy ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 38 def destroy error = false begin if @recording.server server = @recording.server server.send_delete_recordings(@recording.recordid) end = t('bigbluebutton_rails.recordings.notice.destroy.success') rescue BigBlueButton::BigBlueButtonException => e error = true = t('bigbluebutton_rails.recordings.notice.destroy.success_with_bbb_error', :error => e.to_s[0..200]) end # TODO: what if it fails? @recording.destroy respond_with do |format| format.html { if error flash[:error] = redirect_to_using_params else redirect_to_using_params , :notice => end } format.json { if error render :json => { :message => }, :status => :error else render :json => { :message => } end } end end |
#edit ⇒ Object
19 20 21 |
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 19 def edit respond_with(@recording) end |
#index ⇒ Object
10 11 12 13 |
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 10 def index @recordings ||= BigbluebuttonRecording.all respond_with(@recordings) end |
#play ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 73 def play respond_with do |format| format.html { if @playback redirect_to @playback.url else flash[:error] = t('bigbluebutton_rails.recordings.errors.play.no_format') redirect_to_using_params (@recording) end } end end |
#publish ⇒ Object
86 87 88 |
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 86 def publish self.publish_unpublish(true) end |
#show ⇒ Object
15 16 17 |
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 15 def show respond_with(@recording) end |
#unpublish ⇒ Object
90 91 92 |
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 90 def unpublish self.publish_unpublish(false) end |
#update ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/bigbluebutton/recordings_controller.rb', line 23 def update respond_with @recording do |format| if @recording.update_attributes(recording_params) format.html { = t('bigbluebutton_rails.recordings.notice.update.success') redirect_to_using_params @recording, :notice => } format.json { render :json => true, :status => :ok } else format.html { redirect_to_params_or_render :edit } format.json { render :json => @recording.errors., :status => :unprocessable_entity } end end end |