Respond to specific JS file in Rails controller
respond_to do |format|
format.js {
render :template => "path/to/file.js.erb",
:layout => false
}
end
Example:
respond_to do |format|
format.js {
render :template => "users/custom.js.erb",
:layout => false
}
end