我正在开发一个简单的网站,让管理员创建问题,用户解决它们.我使用ActiveAdmin作为管理部分,使用简单的AJAX调用来解决部分用户问题.尝试通过ActiveAdmin :: Devise登录最初是成功的,但无法登出.我删除了所有cookie,从那以后,如果没有CSRF令牌真实性异常,我无法进行POST操作.我在application.html.erb的头部有正确的meta_tags,声明了jquery_ujs(其他线程说它是一个常见问题),在两个POST操作中都存在真实性令牌.我甚至试图通过skip_before_filter避免验证:verify_authenticity_token但ActiveAdmin登录和POST示例仍然失败.日志在下面,您可以看到令牌存在.我还展示了Gemfile,以防任何一个破坏CSRF的东西.
提前致谢.
application.html.erb
<head>
<title>Introducción Matematicas</title>
<%= stylesheet_link_tag "application", media: "all"%>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<link href="http://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700|Roboto+Slab:300,400" rel="stylesheet" type="text/css">
<%= csrf_meta_tags %>
</head>
Run Code Online (Sandbox Code Playgroud)
的application.js
//= require jquery
//= require jquery_ujs
//= require_tree ../../../vendor/assets/javascripts/.
//= require_tree .
Run Code Online (Sandbox Code Playgroud)
应用控制器
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :null_session
#skip_before_filter :verify_authenticity_token
before_filter …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用AWS Elastic Beanstalk部署我的应用程序,但是我收到此错误:
It looks like Bundler could not find a gem. This is probably because your
application is being run under a different environment than it's supposed to.
Please check the following:
* Is this app supposed to be run as the `webapp` user?
* Is this app being run on the correct Ruby interpreter? Below you will
see which Ruby interpreter Phusion Passenger attempted to use. If you
are using RVM, please also check whether the correct gemset …Run Code Online (Sandbox Code Playgroud)