title: Rails Ajax 505 error and cache [POST :action] invalidate, pass error
body: <p>im trying to post data by ajax to a rails controller. But i am getting a 505 internal server error and in my logs im getting a 'cache [POST :action] invalidate, pass error. Here is my code.</p>
  
  <p>ajax code:</p>
  
  <pre><code> send: function(){
    if (notification.isValid() === false){
      return false;
    }
    var eventId = parseInt(window._eventId, 10),
        textarea = $('.sendNotificationTextarea'),
        text = textarea.val(),
        token = $('meta[name="csrf-token"]').attr('content');
    $.ajax({
      url: '/cardboard/events/notify',
      type: 'post',
      data: {
        text: text,
        event_id: eventId,
        emails: notification.getUsersEmails()
      },
      success: function(){
        $('.flashNotify').show().fadeOut(3000);
        textarea.val('');
      }
    });
  }
  </code></pre>
  
  <p>my routes:</p>
  
  <pre><code>post '/cardboard/events/notify', to: 'cardboard/events#notify'
  </code></pre>
  
  <p>controller:</p>
  
  <pre><code>  def notify
      @event = Event.find(params[:event_id])
      description = "Notification about #{event.name}: #{params[:text]}"
      users = User.find_all_by_email(params[:emails])
      Notification.notify(users, description)
      render nothing: true, status: :ok
    end
  </code></pre>
  
  <p>I tried generating csrf tags and sending them through my headers but that didnt work either. </p>
  
  <p>Thanks for you help.</p>