所以我试图让用户录制并停止录制他们所在的会话。
我的路线:
def f(v):
global a
return np.dot( a, v )
A = la.LinearOperator( a.shape, f )
my archives_controller:
resources :archives
post 'stop_recording' => 'archives#stop_recording', as: :stop_recording
和我的js:
for stop_recording.js.erb:
def create
@room = Room.find_by(guid: params[:guid])
archive = OPENTOK.archives.create @room.session_id
@room.archives.create(archive_token: archive.id)
respond_to do |format|
format.js
end
end
def stop_recording
@room = Room.find_by(guid: params[:guid])
@archive = Archive.find_by(room_id: @room.id)
OPENTOK.archives.stop_by_id @archive.archive_token
respond_to do |format|
format.js
end
end
for create.js.erb:
$("#record_form").html("<%= escape_javascript(render('rooms/partials/start_recording')) %>");
和我的偏见:
$("#record_form").html("<%= escape_javascript(render('rooms/partials/stop_recording')) %>");
和
<%= form_for @room.archives.build, remote: true do |f| %>
<%= hidden_field_tag :guid, @room.guid %>
<%= f.button do %>
<i class="fa fa-dot-circle-o"></i>
<% end %>
<% end %>
现在做一个创建工作正常,问题是当我希望stop_recording我得到错误:
<%= form_for stop_recording_path, remote: true do |f| %>
<%= f.button do %>
End Recording
<% end %>
<% end %>
这是会议所在的会议室。
rake路线输出:
ActionController::RoutingError (No route matches [POST] "/rooms/elnlo4"
有什么想法吗?
答案 0 :(得分:1)
Try replacing your stop_recording partial with:
<%= form_tag stop_recording_path, :method => :post, remote: true do %>
<%= hidden_field_tag :guid, @room.guid %>
<%= button_tag do %>
End Recording
<% end %>
<% end %>