forked from External/greenlight
room resources
This commit is contained in:
@ -11,8 +11,13 @@ class RoomsController < ApplicationController
|
||||
room.user = current_user
|
||||
|
||||
if room.save
|
||||
redirect_to room
|
||||
if room_params[:auto_join] == "1"
|
||||
redirect_to start_room_path(room)
|
||||
else
|
||||
redirect_to room
|
||||
end
|
||||
else
|
||||
# Handle room didn't save.
|
||||
|
||||
end
|
||||
end
|
||||
@ -45,6 +50,13 @@ class RoomsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /r/:room_uid
|
||||
def destroy
|
||||
@room.destroy
|
||||
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
# GET /r/:room_uid/start
|
||||
def start
|
||||
# Join the user in and start the meeting.
|
||||
|
@ -38,7 +38,6 @@
|
||||
<% if current_user %>
|
||||
<%= render "shared/modals/create_room_modal" %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<td>
|
||||
<div><%= room.name %></div>
|
||||
<div class="small text-muted">
|
||||
<i>Created on <%= room.created_at.strftime("%B #{room.created_at.day.ordinalize}, %Y") %></i>
|
||||
<i>Created on <%= room.created_at.strftime("%B #{room.created_at.day.ordinalize}, %Y.") %></i>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@ -17,7 +17,9 @@
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fe fe-tag"></i> Action </a>
|
||||
<a href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fe fe-edit-2"></i> Another action </a>
|
||||
<a href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fe fe-trash"></i> Delete</a>
|
||||
<%= button_to room, method: :delete, data: { confirm: 'Are you sure?' }, class: "dropdown-item" do %>
|
||||
<i class="dropdown-icon fe fe-trash"></i> Delete
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
@ -8,7 +8,7 @@
|
||||
</div>
|
||||
|
||||
<hr class="small-rule">
|
||||
<%= form_for(:room, url: create_room_path) do |f| %>
|
||||
<%= form_for(:room, url: rooms_path) do |f| %>
|
||||
<div class="input-icon">
|
||||
<span class="input-icon-addon">
|
||||
<i class="fas fa-chalkboard-teacher"></i>
|
||||
|
Reference in New Issue
Block a user