Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
刘二狗
@coderliu
会员
第 23873 位会员 / 2015-12-07

[email protected]
厦门
2 篇帖子 / 127 条回帖
7 关注者
29 正在关注
62 收藏
GitHub Public Repos
  • iOSAnimationSample 12

    iOS animation samples from JakeLin's Swift lesson

  • Todo 2

    Swift Todo from JakeLin's lesson

  • rubocop 0

    A Ruby static code analyzer and formatter, based on the community Ruby style guide.

  • rubygems.org 0

    The Ruby community's gem hosting service.

  • rms-support-letter.git... 0

    An open letter in support of Richard Matthew Stallman being reinstated by the Free Software Found...

  • capistrano-sneakers 0

    Sneakers support for Capistrano

  • snibox 0

    Self-hosted snippet manager

  • winnie 0

    Monitoring some websites for my lover Winnie 😘

  • graphql.github.io 0

    GraphQL Documentation at graphql.org

  • homeland 0

    :circus_tent: Open source discussion website.

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • ransack 在使用的时候,可能需要注意 distinct 的影响 at 2025年04月26日

    感谢分享,这一点之前还真的没注意过,都是无脑 distinct: true

  • Ruby 编辑器 at 2025年03月21日

    RubyMine 涨价前买了三年,今年到期后不打算续了。

    VSCode + Ruby LSP 体验已经很不错了,最近开始尝试使用 Windsurf。

  • [远程] Tasktag 招聘 Ruby on Rails 中、高级工程师,北美项目,可远程办公 at 2024年11月15日

    顶一下,这两年论坛里的远程岗位越来越少了,主贴提供一下薪资范围就更好了

  • 前后端分离,哪一端处理用户密码加密问题? at 2024年07月25日

    首先 MD5 是摘要算法,不叫加密

  • 解决了 Writebook 产品的中文输入问题 at 2024年07月19日

    好奇是什么原因导致的这个中文支持的问题

  • rails 7.0.6 遇到事务中执行 return,会 rollback 的情况 at 2023年10月22日

    可怕是 master 分支又改回去了

  • ruby 学习环境搭建(wsl+ubuntu+ruby+rubymine+debug) at 2022年08月26日

    感谢楼主的贴子让我一时兴起从 VSCode Remote + Virtualbox 虚拟机的方案切到了 WSL2 + RubyMine。

  • [已招满][远程办公][上海][北京][深圳][杭州][南京] 欧洲铁路公司招聘高级 Ruby 开发工程师 at 2022年07月02日

    这个公司名用 Ruby on Rails 真的太合理了😁

  • ActionText 让人头大!(===== 已解决 =====) at 2022年02月17日

    目测最后查下来都和 ActionText 没关系

  • 【全职远程】外企高薪招聘 Ruby 工程师 at 2021年11月11日

    Cookpad?

  • 使用 MySQL 持久化数据时没有同步的问题 at 2021年09月14日

    能拿到 ID 应该是持久化成功了,save 时的 validation 应该是通过了,感觉 replica 同步延迟的可能性大一些

  • [武汉] 巧议网络 - Elixir 后端工程师(长期招聘) at 2021年09月14日

    之前是在上海吧?这是开分矿了?

  • 推荐一个 Rails 网站作品 at 2021年08月27日

    这 3 位知道自己"说了"这些话吗?说真的,这种做法太 low 了

  • Ruby 的方法查找再往前一步 at 2021年07月30日

    白天在群里看到楼主的讨论,发现自己也不是太清楚这个细节,晚上 Google 搜到的下面的文章 https://medium.com/@leo_hetsch/demystifying-singleton-classes-in-ruby-caf3fa4c9d91 看完之后再看楼主这篇帖子,感觉理解得差不多了。👍

  • 又踩了个 open-uri 的坑,老库的 API 有时候真是摸不着头脑 at 2021年07月14日

    原来 open 在请求小文件的时候返回 StringIO 对象。。。这个特性我都没有找到对应的文档

    这个坑我也踩过😂

  • 怎么实现 unicode 编码,比如想要获取字符串"map"对应的编码内容"map" at 2021年05月31日

    @huacnlee 楼层数不太对

  • 怎么实现 unicode 编码,比如想要获取字符串"map"对应的编码内容"map" at 2021年05月31日
    irb(main):001:0> 'map'.codepoints
    => [109, 97, 112]
    
  • 最近 Basecamp 的瓜有人在吃么? at 2021年05月21日

    DHH 又发了一篇文章,关了 Twitter 评论,转发里骂声一片

  • 记录一下 dashboard 性能优化 (10s->1ms) at 2021年04月13日

    骚操作!学到了👍

  • Headless Analytics stack? at 2021年03月21日

    高产似母猪😉

  • Hypercable Analytics open sourced at 2021年03月02日

    👍

  • 生活中的苹果 at 2020年12月27日

    黑色键鼠在 iMac 出黑色的那年就有了

  • 社区有人做过用户安全审计相关的吗 at 2020年10月22日

    devise 在这块似乎有扩展模块,可以参考一下

  • 如何实现一个信息架构友好的标签系统 at 2020年10月17日

    👍 👍 👍

  • Stimulus 简介 - 谦虚的前端框架 at 2020年08月29日

    三年前线下听了分享的路过。

    感谢 Rei 的分享,我直到去年才开始用 Stimulus😂,很惭愧

  • ActiveAdmin 定制化实战 at 2020年07月14日

    感谢分享,都是一些很实用的技巧,已经接近两年没用 ActiveAdmin 了,翻了翻自己的陈年老代码,我也分享一些个人感觉有些作用的技巧吧😂

    • 指定某些 controller 下引入特定的 JS 文件。当时应该是为了只在需要用到富文本编辑器的页面去引用对应的 JS。
    # config/initializers/active_admin.rb
    module AdminPageLayoutOverride
      def build_active_admin_head
        # you can move the call to super at the end, if you wish
        # to insert things at the begining of the page
        super
    
        # this will be added at the end of <head>
        within @head do
          white_list = %w(admin/announcements admin/distributions admin/introductions admin/versions)
          if params['controller'].in?(white_list)
            text_node javascript_include_tag(params['controller'])
          end
        end
      end
    end
    ActiveAdmin::Views::Pages::Base.send :prepend, AdminPageLayoutOverride
    
    • 增加自定义的 attribute
    # config/initializers/active_admin.rb
    module ActiveAdmin
      module Views
        class RtfContent < ActiveAdmin::Component
          builder_method :rtf_content
    
          def build(content, attributes = {})
            super(attributes)
            textarea class: 'rtf-content-ckeditor', name: SecureRandom.uuid do
              content
            end
          end
        end
      end
    end
    
    • 在多个 namespace 使用 ActiveAdmin + Devise
    # config/initializers/active_admin.rb
    ActiveAdmin.setup do |config|
    #...
      config.namespace :admin do |ns|
        ns.site_title = "Admin System"
        ns.authentication_method = :authenticate_admin_user!
        ns.authorization_adapter = ActiveAdmin::PunditAdapter
        ns.pundit_default_policy = 'AdminPolicy'
        ns.current_user_method = :current_admin_user
        ns.logout_link_path = :destroy_admin_user_session_path
      end
    
      config.namespace :public do |ns|
        ns.site_title = "Public NS"
        ns.site_title_link = '/public'
        ns.authentication_method = :authenticate_teacher!
        ns.current_user_method = :current_teacher
        ns.logout_link_path = :destroy_teacher_session_path
        ns.footer = '教师工作台'
      end
    #...
    end
    
    # Devise 的处理
    class ActiveAdmin::Devise::SessionsController
      def after_sign_out_path_for(resource_or_scope)
        case resource_or_scope
        when :teacher
          new_teacher_session_path
        when :admin_user
          new_admin_user_session_path
        end
      end
    
      def after_sign_in_path_for(resource)
        case resource
        when Teacher
          public_root_path
        when AdminUser
          admin_dashboard_path
        end
      end
    end
    
  • 2.7 开始,私有方法 getter 可以显示指定 self 接收者(会和很多书上的描述打架),getter,setter 保持一致 at 2020年06月24日

    反过来想一想:如果 private 方法在 class 内部都不能调用,那什么时候允许调用?

  • 如何为当前 URL append 参数? at 2020年06月23日

    维护一个允许的参数白名单,但是新增参数的时候一不小心就会忘记掉,导致生成 URL 的时候参数丢失

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