What do I need to enable / install in order to return a response_to block to return js?
Rails 4.2.0
ruby 2.2 (Also tried with 4.0 ... I downgraded to fit the setting as work ...) The console returns an error:
Processing with CameraController # displayed as HTML Completed 406 Not allowed in 2 ms
ActionController :: UnknownFormat (ActionController :: UnknownFormat):
http://apidock.com/rails/Mime mentions that js is a MIME DEFAULT type for Rails. I tried adding it to the header file, but returned a message in the console saying that I did not need to include it in the header file ... What am I missing?
class CameraController < ApplicationController
def show
respond_to do |format|
format.js
end
end
end
...
=link_to "Camera", camera_show_path, remote: true
...
...
get 'camera/show'
...
$("#main_view").html("<%= escape_javascript(render :partial => 'camera/show')%>")