Ruby on rails 跳过对活动管理控制器操作的身份验证

Ruby on rails 跳过对活动管理控制器操作的身份验证,ruby-on-rails,authentication,devise,activeadmin,Ruby On Rails,Authentication,Devise,Activeadmin,我试图允许Arduino通过URL中的参数定期向我的Rails应用程序发布数据。我希望处理此问题的控制器操作跳过身份验证,这样我就不必担心Arduino上的身份验证问题。我的控制器在这里: controller do skip_before_filter :authenticate_admin_user! def capture_data new_record = BoxHouseDataLog.new new_record.box_number

我试图允许Arduino通过URL中的参数定期向我的Rails应用程序发布数据。我希望处理此问题的控制器操作跳过身份验证,这样我就不必担心Arduino上的身份验证问题。我的控制器在这里:

controller do
    skip_before_filter :authenticate_admin_user!
    def capture_data
        new_record = BoxHouseDataLog.new
        new_record.box_number = params[:box_number]
        new_record.run_time_hours = params[:run_time_hours]
        new_record.run_time_minutes = params[:run_time_minutes]
        new_record.run_time_seconds = params[:run_time_seconds]
        new_record.air_temp = params[:air_temp]
        new_record.loop_temp = params[:loop_temp]
        new_record.rh = params[:rh]
        new_record.co2 = params[:co2]
        new_record.o2 = params[:o2]
        new_record.air_temp_setpoint = params[:air_temp_setpoint]
        new_record.loop_temp_setpoint = [:loop_temp_setpoint]
        new_record.rh_setpoint = params[:rh_setpoint]
        new_record.co2_setpoint = params[:co2_setpoint]
        new_record.save
    end
end
在my/config/initializers/active_admin.rb文件中:

config.authentication_method = :authenticate_admin_user!
config.skip_before_filter :authenticate_admin_user!
当我尝试发出请求时,我收到一个401未经授权的错误,并被重定向到使用Desive创建一个新会话

更新: 这是日志

开始 “/捕获数据?框号=1,运行时间=111,运行时间=11,运行时间=11,运行时间=11,空气温度=111.11,循环温度=111.11,相对湿度=111.11,二氧化碳=111.11,氧气=111.11,空气温度设定点=111.11,循环温度设定点=111.11,相对湿度设定点=111.11,二氧化碳设定点=111.11,方法=post” 2014年9月10日11:21:44-0400处理时的127.0.0.1 Admin::BoxHouseDataLogsController#捕获作为HTML参数的数据: {“箱号”=>“1”,“运行时间”=>“111”,“运行时间”=>“11”, “运行时间秒数”=>“11”,“空气温度”=>“111.11”,“循环温度”=>“111.11”, “rh”=>“111.11”、“co2”=>“111.11”、“o2”=>“111.11”, “空气温度设定点”=>“111.11”,“回路温度设定点”=>“111.11”, “相对湿度设定点”=>“111.11”、“二氧化碳设定点”=>“111.11”、“方法”=>“post”} 在4.0毫秒内完成

2014年9月10日11:21:44-0400开始获取127.0.0.1的“/管理员/登录” 由ActiveAdmin::Desive::SessionController处理#以HTML格式新建 不推荐使用警告:不推荐使用f.button,而支持f.actions。 (从按钮处调用) C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/active_admin-b41450a52c09/lib/active_admin/form_builder.rb:119) 弃用警告:f.commit_按钮已弃用,以支持 f、 操作(:提交)。(从位于的提交按钮调用) C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/active_admin-b41450a52c09/lib/active_admin/form_builder.rb:99) 在中呈现活动的\u admin/designe/sessions/new.html.erb 布局/活动管理注销(77.3毫秒)在302.5毫秒内完成200 OK (视图:120.3ms |活动记录:0.0ms)


你能发布你的日志吗?@Mandeep他们似乎没有提供任何关于这个问题的信息。也许我错过了什么?