はじめ
FontAweSomeで削除アイコンを導入
qiita.rb
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
xxx.html.erb
<i class="fa fa-trash-o fa-lg" aria-hidden="true"></i>
Destroy一例
photos_controller.rb
def destroy
@photo = Photo.find(params[:id])
room = @photo.room
@photo.destroy
@photos = Photo.where(room_id: room.id)
respond_to :js
respond_to :jsのファイル
photos/destroy.js.erb
$('#photos').html("<%= j render 'photos_list' %>")