Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
tumayun
@tumayun
VIP
NO. 967 / 2012-02-09

北京多点科技股份有限公司
北京
42 Topics / 769 Replies
15 Followers
3 Following
31 Favorites
奋斗的coder
GitHub Public Repos
  • master_slave 9

    Rails separate read and write

  • blog 0

    私人博客

  • xhttp 0

    http request

  • macos-golink-wrapper 0

    solution to "syscall.Mprotect panic: permission denied" on macOS Catalina 10.15.x

  • go-common 0

    哔哩哔哩 bilibili 网站后台工程 源码

  • eureka-ruby 0

  • remove_emoji 0

    Ruby Remove Emoji 😈🈲😱⁉️ for Ruby 2.x ~ 2.5.x / Rails 4、5.x

  • aliyun-oss-ruby-sdk 0

    Aliyun OSS SDK for Ruby

  • brakeman 0

    A static analysis security vulnerability scanner for Ruby on Rails applications

  • wx_pay 0

    An unofficial simple wechat pay gem

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 求教,求助:sinatra/rails 的会话用 cookie 是怎么生成的? at August 30, 2012

    貌似是 marshal 到 cookies 里面的,看看 cookie_store

  • 如何一行获取嵌套 Hash 数据? at August 30, 2012

    @knwang 最好还是不要用 method_missing 吧,需要查找两遍方法链

  • 如何一行获取嵌套 Hash 数据? at August 30, 2012

    这么多层。。。。 用 try 吧

  • 如何一行获取嵌套 Hash 数据? at August 30, 2012
    data = Hash.new({})
    
  • Is In-logic assignment Bad? at August 30, 2012

    @knwang 呃,我想你误会了,我说的是那篇帖子http://ruby-china.org/topics/5141

  • Is In-logic assignment Bad? at August 30, 2012

    而且在帖子里我也说了 我觉得这样的用法没有什么问题,主要是自己的基础知识不过硬引起的,这次遇到了,我下次就会注意。 那大家都觉得有点问题,好吧,那我也只有说 好吧,这种代码是有点坏味道,但是大家还是应当注意一下,不要在小问题上犯错 大多程序员都有点小固执,讨论着就会有点小火气,大家消消火继续讨论就是了, 只是大家不要歪楼

  • Is In-logic assignment Bad? at August 30, 2012

    @knwang 这个代码是有历史原因的,我的那篇帖子只是想抛出一个问题,引起大家的注意,以后就不会栽在这个上面了,但是似乎大家都不这么想,非要评价并且说服他人,说这样不好,那样不妙,这个我觉得似乎歪楼了

  • [北京] 酷传招聘 Ruby on Rails 全职实习生 / 初级工程师,当然我们也喜欢高手 at August 29, 2012

    哇哇

  • 一个很容易中招的地方 at August 28, 2012

    @hooopo 威武

  • [北京][2012年09月01日] Ruby 活动公告 at August 28, 2012

    @sundevilyang [email protected]

  • [北京][2012年09月01日] Ruby 活动公告 at August 28, 2012

    @sundevilyang 参加也需要报名么?

  • 一个很容易中招的地方 at August 28, 2012

    好吧,这种代码是有点坏味道,但是大家还是应当注意一下,不要在小问题上犯错

  • 两个叹号 at August 28, 2012

    相当于判断是否存在,而且两个!非常醒目

  • Rails with massive data at August 27, 2012

    刚刚在看@xdite 大姐的 blog,很有帮助

  • 一个很容易中招的地方 at August 26, 2012

    额,我不是在评价这种写法好不好,只是提醒一下大家。 或者我想多了。。。

  • 一个很容易中招的地方 at August 25, 2012

    @yakjuly 确实,if 后置就应该只做判断

  • a = 1 && b = a 返回什么结果呢? at August 25, 2012

    @reus

    (a = 1) && (b = a)
    #=> 1
    a
    #=> 1
    b
    #=> 1
    

    @jjym &&的优先级比=高

    a = 1 && b = a
    #=> nil
    a
    #=> nil
    b
    #=> nil
    
  • 一个很容易中招的地方 at August 25, 2012

    @cantin 纯粹的赋值会有你说的问题,加上其他运算就不会有 warning @zw963 我觉得这样的用法没有什么问题,主要是自己的基础知识不过硬引起的,这次遇到了,我下次就会注意。谢谢你的建议,ruby 重构看了一部分。

  • 一个很容易中招的地方 at August 24, 2012

    @sevk 我想你应该没有理解我的问题

  • 一个很容易中招的地方 at August 24, 2012

    @zhaoguobin no! 加括号没有用的 @sevk cc=ee 是赋值语句,返回永远是 true 我觉得这句很有问题 ruby 里面返回的是赋值后的值 这里值为 nil 的话是不会执行下去的...

  • [北京] 久朵网络 招聘靠谱 Ruby 软件工程师 at August 24, 2012

    支持!!!

  • 一个很容易中招的地方 at August 24, 2012

    @HungYuHei 哪加括号?

    a = b if (b = 1.to_s)
    

    这样?

    undefined local variable or method `b' for #<Object:0x7fb6b7b242b8>
    
  • 如何由一个数组得到新的级联数组 at August 24, 2012

    这个用 hash 更好吧

  • [北京][2012年09月01日] Ruby 活动公告 at August 23, 2012

    这么多次没去,这次一定要去

  • version at August 22, 2012

    https://github.com/jnicklas/carrierwave/blob/master/lib/carrierwave/uploader/versions.rb#51

  • version at August 21, 2012
     def version(name, options = {}, &block)
              name = name.to_sym
              unless versions[name]
                uploader = Class.new(self)
                uploader.versions = {}
    
                # Define the enable_processing method for versions so they get the
                # value from the parent class unless explicitly overwritten
                uploader.class_eval <<-RUBY, __FILE__, __LINE__ + 1
    def self.enable_processing(value=nil)
    self.enable_processing = value if value
    if !@enable_processing.nil?
    @enable_processing
    else
    superclass.enable_processing
    end
    end
    RUBY
    
                # Add the current version hash to class attribute :versions
                current_version = {}
                current_version[name] = {
                  :uploader => uploader,
                  :options => options
                }
                self.versions = versions.merge(current_version)
    
                versions[name][:uploader].version_names += [name]
    
                class_eval <<-RUBY
    def #{name}
    versions[:#{name}]
    end
    RUBY
                # as the processors get the output from the previous processors as their
                # input we must not stack the processors here
                versions[name][:uploader].processors = versions[name][:uploader].processors.dup
                versions[name][:uploader].processors.clear
              end
              versions[name][:uploader].class_eval(&block) if block
              versions[name]
            end
    
  • get 一个 url 会返回一个 json 数据,怎么在 rails 里得到这个返回的 json? at August 20, 2012

    response.body

  • 做个小调查,读过 Rails 源码的举一下手。 at August 19, 2012

    看了一部分,rails2 的,rails3 还没怎么看

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