Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
mr liu
@lrbnew
Member
NO. 7451 / 2013-06-05

[email protected]
上海
12 Topics / 31 Replies
1 Followers
0 Following
0 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Padrino 框架 attack prevented by Rack::Protection::AuthenticityToken at October 13, 2015

    参考的其他帖子: https://ruby-china.org/topics/17106 http://cookiebody.github.io/2014/04/20/padrino-csrf-protection.html

  • Padrino 框架 attack prevented by Rack::Protection::AuthenticityToken at October 13, 2015

    从官网找到一段描述,解决了这个问题: Notes for Custom Method Links, I think this should be included in document.

    Since Padrino is using rack-protection, if you just change the link method to post, delete or put without providing a CSRF token, you will get a 403 response, and a warning in the console says: "WARN - attack prevented by Rack::Protection::AuthenticityToken",

    You should create your link like this: link_to "delete item", url(:items, :destroy, :authenticity_token => session[:csrf]), :method => :delete, :confirm => 'Are you sure ?'

    You can get CSRF token by accessing session[:csrf]

  • 欢迎 3 位新的 Ruby China 社区管理员 at October 13, 2015

    +1

  • padrino 开发环境的局域网访问 at October 01, 2015

    没有谷歌,找东西费劲啊

  • padrino 开发环境的局域网访问 at October 01, 2015

    @rei @piecehealth 我用了下面的方法启动,就可以了, padrino start -h 0.0.0.0 就是 rei 资料里面的。开始只找了 padrino --help,里面都没有提-h 选项,还是得看 github 啊

  • padrino 开发环境的局域网访问 at October 01, 2015

    #5 楼 @rei 多谢,这个不错,我仔细查查

  • padrino 开发环境的局域网访问 at October 01, 2015

    #2 楼 @rei 这个是 rails 参数,padrino 没有这个参数

  • padrino 开发环境的局域网访问 at October 01, 2015

    #1 楼 @piecehealth 一样的,3000 端口不对外开放

  • [南京] 10k-20k 暴走漫画诚聘 Ruby 工程师 at September 09, 2015

    #2 楼 @billy 图中 mm 难道是传说中的程序员激励师?

  • 帮忙看一下代码哪里有问题 at July 19, 2015

    #5 楼 @gihnius 多谢

  • 帮忙看一下代码哪里有问题 at July 18, 2015

    #1 楼 @gihnius 问题出在哪呢?没想明白

  • 帮忙看一下代码哪里有问题 at July 18, 2015

    #1 楼 @gihnius 可以了,多谢。 看来还有许多要学习啊

  • ruby-china 源码 如何设置登录后的默认首页为用户主页- at June 27, 2015

    #5 楼 @chaucerling 确实

  • ruby-china 源码 如何设置登录后的默认首页为用户主页- at June 27, 2015

    #3 楼 @chaucerling 在 session controller 里面吗?应该修改 after_sign_in_path_for 这个方法吗 说实话这个 devise 里面的东东,看了好久没看明白

  • ruby-china 源码 如何设置登录后的默认首页为用户主页- at June 27, 2015

    #1 楼 @chaucerling 我是说 routes 配置,里面没有 redirect 方法吧

  • ruby-china 用户 view 的一个问题请教 at June 27, 2015

    #1 楼 @king1990_cool 原来可以这样简写啊,刚知道,多谢

  • 请教一下 ruby-china 的用户页面路由设置 at June 27, 2015

    看到了 多谢

  • 关于 Devise 的 resource 问题 at June 26, 2015

    找到一篇文章 说的很好 http://blog.csdn.net/hexudong08/article/details/7744474

  • 关于 Devise 的 resource 问题 at June 26, 2015

    #1 楼 @mouse_lin warden 是 devise 的知识吗 没找到相关文档描述这个方法啊

  • cpanel -> topic 里面的 source 字段是做什么用的 at June 15, 2015

    知道了,多谢华顺

  • ruby-china 不支持微信浏览器吗 at May 17, 2015

    #1 楼 @rei
    何解?

  • 看了一遍 Programing ruby,下面做些什么小程序练手? at February 17, 2014

    如果是做 web 的话,跟着 sinatra just do it 走一遍,一个有模有样的 website 就造出来了

  • 为什么 centos 中的 crontable 不能运行我的 ruby 脚本 呢? at June 08, 2013

    很明显,你写的是 ruby /opt/tools/mysqlbackup.rb,但是 crontab 不知道 ruby 在哪里,最简单的解决办法就是给 ruby 前面加路径,比如:/usr/bin/ruby /opt/tools/mysqlbackup.rb

  • ssh 自动断开后,再也连接不上 at June 08, 2013

    可能是 IP 冲突引起的,最好在交换机上面把自动分配的 ip 地址池和固定 ip 的地址池进行区分 比如 192.168.1.1-100 做自动分配地址池,从 100-254 做固定 ip 段

  • 删不掉编译安装的 ruby 2.0,如何解决? at June 08, 2013

    你环境变量里面,ruby 还是指向旧的吧。 你可以使用 which ruby 查看这个 ruby 是哪个。然后用 ls -l 看这个 ruby,如果是链接,就删掉它重新做一个新软链接到你新 ruby

关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English