forked from External/greenlight
		
	* <Added modal for rename> * <Commit changes and switch branch> * <Javascript Scaffolding for rename room feature> * <Created room_block.js> * <update changes> * <Updating rename branch> * <Update rename.js> * <Update branch> * <Update branch> * <Implemented renaming of room blocks> * <Refactoring code> * Remove modal due to new design * <Finished renaming of rooms> * <Updated renaming of recordings> * <updating branch> * <added renaming of recordings> * <update branch> * <> * <Fixed code style> * <Fixed rspec tests> * Update application.js
This commit is contained in:
		@@ -50,6 +50,19 @@ class RoomsController < ApplicationController
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # PATCH /:room_uid
 | 
			
		||||
  def update
 | 
			
		||||
    if params[:setting] == "rename_block"
 | 
			
		||||
      @room = Room.find_by!(uid: params[:room_block_uid])
 | 
			
		||||
      update_room_attributes
 | 
			
		||||
    elsif params[:setting] == "rename_header"
 | 
			
		||||
      update_room_attributes
 | 
			
		||||
    elsif params[:setting] == "rename_recording"
 | 
			
		||||
      @room.update_recording(params[:record_id], "meta_name" => params[:record_name])
 | 
			
		||||
    end
 | 
			
		||||
    redirect_to room_path
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # POST /:room_uid
 | 
			
		||||
  def join
 | 
			
		||||
    opts = default_meeting_options
 | 
			
		||||
@@ -159,6 +172,12 @@ class RoomsController < ApplicationController
 | 
			
		||||
 | 
			
		||||
  private
 | 
			
		||||
 | 
			
		||||
  def update_room_attributes
 | 
			
		||||
    if @room.owned_by?(current_user) && @room != current_user.main_room
 | 
			
		||||
      @room.update_attributes(name: params[:room_name])
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def room_params
 | 
			
		||||
    params.require(:room).permit(:name, :auto_join)
 | 
			
		||||
  end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user