Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
bolide
@badboy
会员
第 5210 位会员 / 2013-01-10

深圳
15 篇帖子 / 794 条回帖
8 关注者
1 正在关注
0 收藏
30岁了,希望飞翔,但是我没翅膀
GitHub Public Repos
  • MyAnimal 6

    rubymotion for ios ,app的名字叫《陪孩子听动物的声音》,这是整个app的源码,欢迎大家加入rubymotion,让我们一起用ruby实现更多app

  • NextNumber 5

    Let the number with the next one

  • system_log 3

    system log show in view

  • system_log_rails2 0

    system log show in view,Run in rails2 environment

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Rails controller 里面 format 都有什么类型? at 2013年02月25日

    这个类型你可以随便先啊

    format.fuck { render json: @project }

    这样也可以啊,只要你的 url 里带上:format=>:fuck 就会返回后面的 json 的那个@project

    这样讲应该明白了吧?

  • [已结束][上海] 掌誉网络科技招聘靠谱 Ruby 程序员 - 你看了以后可能几天都睡不好觉的招聘帖 at 2013年02月25日

    离开深圳需要多大的动力呢。。。谁能告诉我!!!

  • 小心身体,少熬夜别太累 at 2013年02月25日

    据说是偏方,找来蛇皮,掺些烟头的丝,然后揉碎,放点水搅和,然后外敷。

  • [北京] 创业团队招 ruby on rails 工程师 at 2013年02月22日

    呼叫蜗牛 @ywencn

    大鱼,你们盈利了吗?

  • [北京] 创业团队招 ruby on rails 工程师 at 2013年02月22日

    蜗牛,你之前那个旅游的跟他们这个大鱼,哪个能发展起来?

  • [北京] 创业团队招 ruby on rails 工程师 at 2013年02月22日

    挺喜欢

  • 实现类似微信查看附近的人有啥好办法 at 2013年02月22日

    我的做法是,通过当前经纬度和周边范围的半径,计算出 2 个点。这样讲估计你已经知道怎么做了。

    然后就通过这两个点的经纬度来做索引条件。 得到一个比较小的数量,然后再排序。

  • 在 Rails 的领域,怎样算作 “入行”? at 2013年02月22日

    @nightire 哎呀,你是要跟楼主说,不是跟我说。。。 @daweiba 想当初,我是大约 3 年多没收入呢,3K 左右艰难的前进

  • 初学 Rails,寻找师傅一枚 at 2013年02月21日

    当老师很吃香

  • 在 Rails 的领域,怎样算作 “入行”? at 2013年02月21日

    嘿嘿,我也来胡扯。 得从 2 个方向看待入门。 一个是技术方面;另一个是综合能力。 技术方面呢,web 开发的技术都需要能了解,能上手,如果是 web 的话,html、css、js,以及后端(那个啥美工不一定包括)。并且能够设计,设计也属于技术类。我觉得入门的程度呢,就是需求来了,你能够自己了解,google 查找,最后实现。

    综合能力呢,包括团队协助,客户沟通等。别小看这个,你的组长给你安排的任务,你理解偏了,那就是问题。

  • block 类型的参数怎么看 api? at 2013年02月20日

    这是我用 netbeans 按 ctrl + 鼠标左键点击 render 出来滴:

    C:\Ruby187\lib\ruby\gems\1.8\gems\actionpack-3.2.8\lib\action_view\helpers\rendering_helper.rb

    module ActionView
      module Helpers
        # = Action View Rendering
        #
        # Implements methods that allow rendering from a view context.
        # In order to use this module, all you need is to implement
        # view_renderer that returns an ActionView::Renderer object.
        module RenderingHelper
          # Returns the result of a render that's dictated by the options hash. The primary options are:
          #
          # * <tt>:partial</tt> - See <tt>ActionView::PartialRenderer</tt>.
          # * <tt>:file</tt> - Renders an explicit template file (this used to be the old default), add :locals to pass in those.
          # * <tt>:inline</tt> - Renders an inline template similar to how it's done in the controller.
          # * <tt>:text</tt> - Renders the text passed in out.
          #
          # If no options hash is passed or :update specified, the default is to render a partial and use the second parameter
          # as the locals hash.
          def render(options = {}, locals = {}, &block)
            case options
            when Hash
              if block_given?
                view_renderer.render_partial(self, options.merge(:partial => options[:layout]), &block)
              else
                view_renderer.render(self, options)
              end
            else
              view_renderer.render_partial(self, :partial => options, :locals => locals)
            end
          end
    

    看到这个注释很熟悉了吗?

  • block 类型的参数怎么看 api? at 2013年02月20日

    用 IDE 就能看到文档内容,netbeans 或者 rubymine 都可以 安装 ctrl 然后鼠标点 render 方法名,然后就到源码了,注释就是 ruby 的文档内容了

    ruby 好像有个可以产生文档的命令,会把注释都添加到文档里,忘了是啥,谁知道的补上

  • 我来深圳了,有什么活动参加,或工作介绍吗 at 2013年02月20日

    @smallbug 没生娃就有希望

  • 我来深圳了,有什么活动参加,或工作介绍吗 at 2013年02月20日

    @smallbug 要屡败屡战啊,男追女丢套房,女追男抱金砖啊!哇哈哈

  • 我来深圳了,有什么活动参加,或工作介绍吗 at 2013年02月20日

    @smallbug 你把老谢带上,我就带你

  • 人生旅程 (梦想就是一坨屎) at 2013年02月20日

    荣誉、健康、开心、收入 的平衡点

  • 我来深圳了,有什么活动参加,或工作介绍吗 at 2013年02月20日

    @ganweiliang 情情?快请大哥我吃饭

  • 要不要换一份工作 at 2013年02月19日

    羡慕帝都的企业数量

  • Ruby 语言二十岁生日,如果你采访 Matz,你会问什么? at 2013年02月19日

    第一句会问他,能说中文吗?嘿嘿

  • [广州] 广州云宏信息科技有限公司诚聘高级 ruby 工程师 at 2013年02月18日

    阿南,你要去广州不

  • [广州] 广州云宏信息科技有限公司诚聘高级 ruby 工程师 at 2013年02月18日

    再考虑下吧

  • [广州] 广州云宏信息科技有限公司诚聘高级 ruby 工程师 at 2013年02月18日

    广州好远

  • [广州] 广州云宏信息科技有限公司诚聘高级 ruby 工程师 at 2013年02月18日

    还挺合适的

  • 我来深圳了,有什么活动参加,或工作介绍吗 at 2013年02月18日

    @smallbug 小虫带我

  • 如何知道一个类定义完了? at 2013年02月18日

    把你那些诡异的东西封装到 gem 里呗,要哪个 gem,装一个

  • 我来深圳了,有什么活动参加,或工作介绍吗 at 2013年02月18日

    小虫带我玩

  • 如何知道一个类定义完了? at 2013年02月18日

    看你这需求蛋疼得狠,呵呵

  • 如何知道一个类定义完了? at 2013年02月18日

    动态加进去呢?嘿嘿,淫荡就淫荡得彻底一点

    #定义config
    CONFIG={"A"=>["M1"],"B"=>["M2"],"C"=>["M3"]}
    #module块
    module M1
    def a
        puts "this is M1 on A"
    end
    end
    module M2
    def a
        puts "this is M2 on B"
    end
    end
    module M3
    def a
        puts "this is M3 on C"
    end
    end
    
    #include负责向类(的实例)追加功能,而extend则只向某特定的对象追加模块的功能.
    #这里修改父类
    class Object
     def load_config_module
        CONFIG[self.class.to_s].each do |module_name|
            eval("extend #{module_name}")
        end if CONFIG && CONFIG[self.class.to_s]
     end
    end
    #类
    class A
      def initialize
       load_config_module
      end
    end
    
    class B < A
        def a
            puts "fuck b"
        end
    end
    
    class C < A
        def a
            puts "fuck c"
        end
    end
    
    puts "======A========"
    A.new.a
    puts "======B========"
    B.new.a
    puts "======C========"
    C.new.a
    
    #结果
    $ ruby testrb.rb
    ======A========
    this is M1 on A
    ======B========
    this is M2 on B
    ======C========
    this is M3 on C
    

    不过如果你的业务很复杂,建议你做成 gem 包 或者参考@kenshin54 说的,在 rails 层面上在 config.after_initialize,加载完后再载入你的混入。。。

  • 如何知道一个类定义完了? at 2013年02月18日

    好吧。。。我错了。

  • 如何知道一个类定义完了? at 2013年02月18日

    我给你的例子就是啊!

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