Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
tiemei
@tiemei
高级会员
第 1836 位会员 / 2012-04-17

长沙->杭州
2 篇帖子 / 75 条回帖
0 关注者
1 正在关注
41 收藏
Ruby不,就是诗歌
GitHub Public Repos
  • kuaipan 9

    金山快盘SDK的ruby版本(the third party)

  • defworld-ruhoh 1

    defworld.com 改成用ruhoh

  • kp_folder 1

    kuaipan sync folder tool

  • Douyin-Bot 0

    😍 Python 抖音机器人,论如何在抖音上找到漂亮小姐姐?

  • Yuemiao 0

    约苗HPV 抢苗时间预览

  • dubbox 0

    Dubbox now means Dubbo eXtensions, and it adds features like RESTful remoting, Kyro/FST serializa...

  • KE-complex_modifications 0

  • cookies 0

    Load and save cookies within your React application

  • catguild 0

    任务发布

  • ajax 0

    原生的ajax,整合了jsonp跨域功能

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 我写的论坛软件现已开源:Rabel - PB2 on Rails at 2015年09月08日

    这个还维护么?有自带的管理后台么

  • 发来你就觉得最酷的一段代码,我要把它印成 T 恤 at 2013年05月12日

    public static void main(String args[]) { // TODO }

  • [长三角][2013年5月11日] Ruby 开发者沙龙 at 2013年05月12日

    @ShiningRay @eyeplum @flyerhzm 不知可否分享 ppt? 会后还想好好回味下, @yedingding 另,求视频地址

  • 空间,新浪微博,人人,一键发送有木有呢? at 2013年04月09日

    曾经自己将 sina weibo 集成到 vim 里发送

  • decaf - runs Ruby in the browser at 2013年04月09日

    一个支持 ruby 的引擎,谁会用它来做一个浏览器?还是可以作为插件什么的嵌入现有的浏览器?

  • Reeder for Mac & iPad 免费了 at 2013年04月03日

    就算支持它的服务吧,我两者都卖了,希望它以后也能好好活下去

  • 国外的一篇 web 框架大比拼的文章,跟 robbin 的文章可以对照来看 at 2013年03月30日

    #5 楼 @Rei Spring 为例,亦支持 GlobalExceptionHander,throw 掉就行。至于需要单独考虑的异常,ruby 也免不了。

  • 国外的一篇 web 框架大比拼的文章,跟 robbin 的文章可以对照来看 at 2013年03月30日

    长度问题不能这么比吧,你不能把准备 statement,异常处理只加在 java 里,rails 难道不需要。

  • session 中的 flash 使用诡异问题 at 2013年03月29日

    #19 楼 @Rei

    jiadongkais-MacBook-Pro:blog jiadongkai$ rails -v Rails 3.2.12 jiadongkais-MacBook-Pro:blog jiadongkai$ ruby -v ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0] jiadongkais-MacBook-Pro:blog jiadongkai$ gem -v 2.0.3

    复现步骤:

    git clone https://github.com/tiemei/blog.git cd blog bundle install (修改 database.yml) rake db:migrate rails server

    http://localhost:3000/users/new 注册新用户 http://localhost:3000/login 登陆 http://localhost:3000/articles/new 填写内容提交

  • session 中的 flash 使用诡异问题 at 2013年03月29日

    #17 楼 @Rei

    抱歉

  • session 中的 flash 使用诡异问题 at 2013年03月29日

    #15 楼 @Rei 这段竟然会报 undefined method `[]' for nil:NilClass?

    logger.debug session

    再 create 开头和 redirect 之前及 show 方法里安置 debug

    输出:

    ========step1 in articles#create #, @closed=false, @flashes={}, @now=nil> #User:0x007fe0c6138298

    ========step2 in articles@create #, @closed=false, @flashes={:article=>#

    , :n=>"dfasdfds"}, @now=nil> #User:0x007fe0c6138298

    ========in articles#show #, @closed=false, @flashes={}, @now=nil> #User:0x007fe0c62403c0

  • session 中的 flash 使用诡异问题 at 2013年03月29日

    #13 楼 @Rei 不会重名 在 show action 加上

    flash[:n] = 'set flash[:n] in articles#show'

    debug 出这段

    ========in articles@show#, @closed=false, @flashes={:n=>"set flash[:n] in articles#show"}, @now=nil>

    且 view 里的 flash[:n] 也生效了,一般不是要下面这种方式 same request 才生效的么?

    flash.now[:n] = '....' 竟然改变了 flash 的默认 next request show 的行为

  • session 中的 flash 使用诡异问题 at 2013年03月29日

    #11 楼 @Rei 跳转后新请求这段日志

    Redirected to http://localhost:3000/articles/33 Completed 302 Found in 15ms (ActiveRecord: 3.2ms)

    Started GET "/articles/33" for 127.0.0.1 at 2013-03-29 15:52:10 +0800 Processing by ArticlesController#show as HTML Parameters: {"id"=>"33"} Article Load (0.3ms) SELECT articles.* FROM articles WHERE articles.id = 33 LIMIT 1 Rendered articles/show.html.erb within layouts/application (0.2ms) Completed 200 OK in 6ms (Views: 4.1ms | ActiveRecord: 0.3ms)

    我又加了再 show 里加了一段 debug,却是 flash 被清空了

    ========in articles@show#, @closed=false, @flashes={}, @now=nil>

  • session 中的 flash 使用诡异问题 at 2013年03月29日

    #8 楼 @Rei 图片太宽了,重新贴文字:

    ========before #, @closed=false, @flashes={}, @now=nil>

    =========after #, @closed=false, @flashes={:article=>#

    , :n=>"dfasdfds"}, @now=nil>

  • session 中的 flash 使用诡异问题 at 2013年03月29日

    #6 楼 @Rei

    config/initializers/session_store.rb

    Blog::Application.config.session_store :active_record_store

    难道是这边我的误用?

  • session 中的 flash 使用诡异问题 at 2013年03月29日

    #3 楼 @Rei

    HomeController < ... def from flash[:n] = 'set flash[:n] in home#from' flash.keep(:n) redirect_to '/to' end

    def to end end router:

    match 'from' => 'home#from' match 'to' => 'home#to'

    view:

    <%= flash[:n] %>

    经过上面 create 那段逻辑后,这里请求 /from 跳转后的页面也为空

    登出后,请求/from flash 工作恢复正常,再次登入也正常,但是走过一次 create 逻辑后,一切又失败了

    登出逻辑:

    def logout session[:current_user] = nil redirect_to '/login' end

  • session 中的 flash 使用诡异问题 at 2013年03月29日

    #3 楼 @Rei logger.debug 输出为空,页面

    <%= flash[:n] %>

    也为空

    并且,走过一边 create 逻辑后,其他地方的 flash 也失效了

  • session 中的 flash 使用诡异问题 at 2013年03月29日

    #1 楼 @Rei 已重新编辑

  • ruby 和 python 某些方面是不是有点逗 at 2012年12月17日

    #4 楼 @lufeihaidao 太经典了

  • 温度过低,手机将停止工作 at 2012年11月10日

    我们尚且捂被窝了

  • [头脑风暴] 除了钱,大家还喜欢其他什么激励 at 2012年10月18日

    认同感,聊得来最重要

  • 画流程图,类图是用什么工具的... at 2012年10月12日

    Google 图表和可视化工具

  • 大家一般在哪写博客 at 2012年09月02日

    格式 markdown,用 dropbox 云端同步。喜欢标记语言简洁的格式,用 sublime 编辑。

  • 请 18 岁以下的同学举个手 (年龄调查) at 2012年08月31日

    太早了,个人觉得没必要。年轻时太早定了方向,影响生命的宽度。

  • [杭州] 我们是创业团队 ,我们需要你 at 2012年08月24日

    可以透露更多吗?感觉什么都没说

  • [澳大利亚,中国] 澳大利亚公司招聘 Ruby on Rails 程序师 有机会工作在澳洲 at 2012年08月24日

    3.对于 Git 有一定了解,能结合 Github 这是用 Rails 三年还需说明的要求吗?汗~~

  • [小题大作微公益] 我的公益 gap year,还缺一个 rubyist 的你 at 2012年08月16日

    已经在工作,可否周末远程办公?无需工资,纯熟爱好

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