Fixed #303 Add the ability to rename rooms and recordings (GRN-18) (#304)

* <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:
John Ma
2018-12-04 10:48:51 -05:00
committed by Jesus Federico
parent efa9e08dfc
commit 41a543f6b8
13 changed files with 285 additions and 9 deletions

View File

@ -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