Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Rei
@Rei
Admin
NO. 1 / 2011-10-28

[email protected]
深圳
182 Topics / 9130 Replies
727 Followers
0 Following
11 Favorites
中下水平 Rails 程序员
Reward
GitHub Public Repos
  • writings 940

    [Closed] Source code of writings.io

  • alipay 732

    Unofficial alipay ruby gem

  • code_campo 291

    [Closed] Source code of http://codecampo.com

  • asciidoctor-pdf-cjk-ka... 101

    **no longer maintained**

  • asciidoctor-htmlbook 31

    Asciidoctor HTMLBook is an Asciidoctor backend for converting AsciiDoc documents to HTMLBook docu...

  • material-ui 17

  • rich-text-editor 12

  • htmlrenderer 12

  • rails-chatgpt-demo 8

  • rails-app 7

    A Rails project template lets me start new projects quickly.

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 新手求解 rails server 时遇到的问题 at February 20, 2016
    $ bundle install
    $ rails s
    

    没有 sudo,bundle 需要 sudo 的时候会自己请求密码。

  • [有偿求助] Rails MissingTemplate error at February 19, 2016

    一个方法是加个 Middleware,把 */*; 改写为 text/html, */*;,这样应用层不需要改变。

  • [有偿求助] Rails MissingTemplate error at February 19, 2016

    一般是劣质爬虫才会请求*/*;,所以我一般忽略这个错误,这里可以忽略 User Agent BIDUBrowser。不知有没有更好的处理方法?

  • [有偿求助] Rails MissingTemplate error at February 19, 2016

    贴日志要谨慎,secret_key_base 泄露了,我已经帮编辑。

  • Rails Model 继承的疑问 at February 18, 2016

    关联是可以继承的,我新开了个 Rails 项目测试通过。楼主不用 factory 看看 ProjectMember 有没有 user 关联方法?

  • Rails Model 继承的疑问 at February 18, 2016

    Rails 版本?

  • 制作了一本 CSS/SVG 小书 at February 17, 2016

    提供试读会比较好噢。

  • 我想请教几个 Ruby 和 Rails 的问题.希望有人能指点下. at February 13, 2016

    #2 楼 @happyming9527

    All subdirectories of app in the application and engines. For example, app/controllers. They do not need to be the default ones, any custom directories like app/workers belong automatically to autoload_paths.

    http://guides.rubyonrails.org/autoloading_and_reloading_constants.html#autoload-paths

  • 我想请教几个 Ruby 和 Rails 的问题.希望有人能指点下. at February 13, 2016

    1. 可以放在 app/models,或者在 app/ 下新建目录:

    # app/services/my_service.rb
    class MyService
    end
    

    类名要对应文件名,不然 Rails 不会自动加载。services 也可以是别的名字。

    2. 用数组

    list = []
    list.push MyModel.new
    result = list.find_all{|item| item.key == 'a'}
    

    但是 Ruby 的列表没有类型声明,会不会 push 进了别的对象要靠自己的代码保证。

  • 如何在 Ubuntu 14.03 Server 上安装 mina 的一键部署环境 at February 12, 2016

    执行未知来源的脚本会有很大风险。

  • Ruby China 官方 iOS 客户端已发布上线 at February 06, 2016

    #4 楼 @huacnlee Turbolinks 5! https://github.com/turbolinks/turbolinks

  • 偌大的 Java 圈为什么就没有 Rails 和 Django 这么好用的 migration? at February 06, 2016

    SQL 挺好的,要用某个数据特有的功能还是要写原生语句。

  • 作为个今年才毕业的应届生,对于现在自己的情况想问问大家的意见。 at February 05, 2016

    https://ruby-china.org/jobs

  • 我昨天发的关于如何让异常抛出的帖子怎么被删除了 at February 03, 2016

    #5 楼 @huacnlee 回复点赞好像会顶起帖子,是预期行为吗?

  • 点击 button 运行某 Ruby 方法 at February 03, 2016

    http://apidock.com/rails/ActionView/Helpers/UrlHelper/button_to

  • 点击 button 运行某 Ruby 方法 at February 03, 2016

    你的思路是?

  • 报错了说:wrong number of arguments (1 for 2) ,找了好久没搞定,求大神指点迷津,谢谢 at February 01, 2016

    猜你是需要 @feedback.update_attributes

  • 什么时候进行异常捕获 at February 01, 2016

    rescue 要指定类型啊。

  • 关于哈希取值 at January 31, 2016

    因为 "name" 是 String,:name 是 Symbol。

  • 终于在 Windows 下用上了 Ruby China,泪流满面啊... at January 31, 2016

    就算用 Mac,如果要让开发和部署环境一致,还是要 Vagrant。

  • 申手党:Nokogiri 如何搞定这个文本? at January 30, 2016

    标题的“伸手党”和正文第一段文字完全没有意义,只会降低获得回答的可能性。

  • 请叫如何优雅的处理竞态条件? at January 30, 2016

    http://apidock.com/rails/ActiveRecord/CounterCache/ClassMethods/update_counters

  • 请叫如何优雅的处理竞态条件? at January 30, 2016

    有什么问题?你期望是什么结果?

  • 看过 yinwang 写的这篇文章, 很想了解大家怎么看的 at January 29, 2016

    建议到锤子科技上班。

  • 测试到底是什么? at January 28, 2016

    测试的主要作用和必要体现在哪? https://ruby-china.org/topics/28355

  • Rails 10 週年:網站改版、新 Logo、書以及視頻 at January 20, 2016

    Ruby on Rails doctrine 好像就是一篇文章吧?

  • Rails sanitize allowed_attributes 不安全 at January 18, 2016

    #3 楼 @quakewang 我觉得把这段

    def scrub_attributes(node)
      if @attributes
        node.attribute_nodes.each do |attr|
          attr.remove if scrub_attribute?(attr.name)
        end
    
        scrub_css_attribute(node)
      else
        Loofah::HTML5::Scrub.scrub_attributes(node)
      end
    end
    

    改成这样就好了:

    def scrub_attributes(node)
      if @attributes
        node.attribute_nodes.each do |attr|
          attr.remove if scrub_attribute?(attr.name)
        end
      end
      Loofah::HTML5::Scrub.scrub_attributes(node)
    end
    

    Loofah::HTML5::Scrub 里面还有不少规则,也不知道以后会再加什么规则,全部继承才能利用到。

    然后看了 sanitize,觉得这个 gem 规则设置要容易一些。

  • 关于 Gem 的几个问题 at January 18, 2016

    自己写~ 😄

    其实 Rails 就是最大公约数了,业务部分都是各有不同应该自己写。

  • 别用 raw 和 html_safe at January 17, 2016

    #3 楼 @jasl WoW,我现在才理解你说的内容。 👍

  • Rails sqlite3 时间显示 at January 15, 2016

    刚好看到个漫画 http://www.commitstrip.com/en/2016/01/14/a-story-about-timestamp-and-timezone/

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