So I'm doing an ajax call to a Rails 4.2 app setup with devise like this:
$.ajax
url: '/some_ajax_call',
type: 'POST',
dataType: "json",
beforeSend: (xhr) ->
xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))
data: { yo: "yes" },
success: (response) ->
console.log('hello')
I end up with a params hash in the Rails controller structured like this:
{ "data" => { "yo" => "yes" } } #params
Is there a way to do the AJAX call so that I end up with the following params hash instead (basically the params minus the data key)
{ "yo" => "yes" } #params