Sha256: 394bb5ab0fa3fcf02a69b13375d631eabd1eb47129a072a9e101969ad1ad7f68

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

class Bigbluebutton::PlaybackTypesController < ApplicationController
  include BigbluebuttonRails::InternalControllerMethods

  respond_to :html
  respond_to :json
  before_filter :find_playback_type, only: [:update]

  def update
    respond_with @playback_type do |format|
      if @playback_type.update_attributes(playback_type_params)
        format.html {
          message = t('bigbluebutton_rails.playback_types.notice.update.success')
          redirect_to_using_params request.referer, :notice => message
        }
        format.json { render :json => true, :status => :ok }
      else
        format.html {
          flash[:error] = @playback_type.errors.full_messages.join(", ")
          redirect_to_using_params request.referer
        }
        format.json { render :json => @playback_type.errors.full_messages, :status => :unprocessable_entity }
      end
    end
  end

  protected

  def find_playback_type
    @playback_type ||= BigbluebuttonPlaybackType.find(params[:id])
  end

  def playback_type_params
    unless params[:bigbluebutton_playback_type].nil?
      params[:bigbluebutton_playback_type].permit(*playback_type_allowed_params)
    else
      {}
    end
  end

  def playback_type_allowed_params
    [ :visible, :default ]
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bigbluebutton_rails-2.2.0 app/controllers/bigbluebutton/playback_types_controller.rb
bigbluebutton_rails-2.1.0 app/controllers/bigbluebutton/playback_types_controller.rb
bigbluebutton_rails-2.0.0 app/controllers/bigbluebutton/playback_types_controller.rb