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

chloerei@gmail.com
深圳
182 Topics / 9127 Replies
727 Followers
0 Following
11 Favorites
中下水平 Rails 程序员
Reward
GitHub Public Repos
  • writings 939

    [Closed] Source code of writings.io

  • alipay 731

    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 10

  • 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
  • Sublime 作为 Markdown 编辑器大家有什么心得吗? at November 15, 2013

    iA Writer

  • 松本行弘的新书《关于 mRuby 的一切》 at November 15, 2013

    我希望能有 epub 格式电子书。

  • Post 与 Comment 关联删除的时候, at November 15, 2013

    因为它这里用了嵌套路由

    resources :posts do
      resources :comments
    end
    

    Url 模式是:

    /posts/:post_id/comments/:id
    

    你可以用

    rake routes
    

    来查看现在的路由规则。

  • 表单的 id 到底代表什么,很困惑 at November 15, 2013

    #6 楼 @shangrenzhidao 是啊,就是这么来的。

  • 表单的 id 到底代表什么,很困惑 at November 15, 2013

    #4 楼 @shangrenzhidao 试试 @event.to_param 的结果。

  • 表单的 id 到底代表什么,很困惑 at November 15, 2013

    #2 楼 @shangrenzhidao HTML 的 id,根据表单参数自动生成的,现在用不上。

  • 表单的 id 到底代表什么,很困惑 at November 15, 2013
    action="/events/update/1"
    

    这个 1 就是 id。楼主连着发了很多入门提问贴了,请多看书多思考。

  • 如何使用 fontawesome at November 15, 2013

    加

    gem 'therubyracer'
    

    https://github.com/cowboyd/commonjs.rb 目前只支持这两个

    • The Ruby Racer (V8) - [https://github.com/cowboyd/therubyracer]
    • The Ruby Rhino (JRuby) - [https://github.com/cowboyd/therubyrhino]
  • 如何使用 fontawesome at November 15, 2013

    #16 楼 @jxs471494539 怎么没有 fontawesome

  • 如何使用 fontawesome at November 15, 2013

    用 less 要麻烦一些了,它要 load js runtime,require js 的库 less。把 Gemfile.lock 列出来,看现在用了什么 js runtime。

  • 如何使用 fontawesome at November 15, 2013

    顶楼说的 gem 是 sass,这里怎么装了 less。

  • 如何使用 fontawesome at November 15, 2013

    #9 楼 @jxs471494539 对。

  • [已解决] mongoid 的短板?无法实现 accepts_nested_attributes_for 的 find_or_create 方式 at November 15, 2013

    #12 楼 @hardywu 如果有这么细致的要求我就用 4 楼的方法了。

  • [已解决] mongoid 的短板?无法实现 accepts_nested_attributes_for 的 find_or_create 方式 at November 15, 2013
    class Band
      include Mongoid::Document
      embeds_many :albums
      accepts_nested_attributes_for :albums,
        reject_if: ->(attrs){ attrs[:name] == "Violator" }
    end
    

    文档碉堡了 http://mongoid.org/en/mongoid/docs/nested_attributes.html

  • 如何使用 fontawesome at November 15, 2013

    语法错了,把那行放在 *= require_tree 的前面,成为注释的一部分。

  • [已解决] mongoid 的短板?无法实现 accepts_nested_attributes_for 的 find_or_create 方式 at November 15, 2013

    奥,不用索引,加唯一校验就行了。

  • 如何使用 fontawesome at November 15, 2013

    开浏览器调试,看看有读取 font-awesome 相关的 css 没,再看看内容,正不正常。

  • [已解决] mongoid 的短板?无法实现 accepts_nested_attributes_for 的 find_or_create 方式 at November 15, 2013

    #7 楼 @hardywu 测试一下,我印象中就是没写入,但是实例看不出异常,立即使用可能会有 bug。

  • 如何使用 fontawesome at November 15, 2013

    If you use Rails/Sprockets, add this to e.g. application.css.scss:

    *= require font-awesome

    这个做了没。

  • 如何使用 fontawesome at November 15, 2013

    但配置了好久都不成功

    怎么不成功法

  • [已解决] mongoid 的短板?无法实现 accepts_nested_attributes_for 的 find_or_create 方式 at November 15, 2013

    #5 楼 @hardywu 给 alias model 加唯一索引,重复写入的时候静默失败。

  • 如何用代码描述问题而不是过程式思考? at November 15, 2013

    每个语言都有它的惯用法,多参考开源软件的源码。

  • [已解决] mongoid 的短板?无法实现 accepts_nested_attributes_for 的 find_or_create 方式 at November 15, 2013

    有必要一定要用 nested_attributes 实现吗?

    foo = Foo.create params[:foo]
    params[:foo][:aliases].each { |alias_params| foo.aliases.find_or_create_by(alias_params) }
    
  • 想自己搭一个框架,删了 index.html 之后,就不知道怎么下手了,有没有人指导一下? at November 15, 2013

    http://ruby-china.org/wiki/books

  • 并行赋值的使用场景 at November 14, 2013

    #16 楼 @luikore 原来如此 👍

  • 这些冒号让我很困惑 at November 14, 2013

    :name 的值就是 :name,我一开始都没想那么多。

  • 求助,也许是 linux 的问题 at November 14, 2013

    Note: The Multi-User install instructions must be prefixed with the 'sudo' command. However, once the install is complete, and the instructions to add users to the rvm group is followed, the use of either sudo or rvmsudo is no longer required. The 'sudo' command is only to temporarily elevate privileges so the installer can complete it's work. If you need to use 'sudo' or 'rvmsudo' after the install is complete, some part of the install directions were not properly followed. This usually is because people execute the install as root, rather than executing the installation instructions from a non-privileged user account.

    这里说用 sudo 安装跟用 root 安装还不一样,root 会导致一些问题。

    正常 multi-user 模式是普通用户用 sudo 安装,然后将用户加到 rvm 组,之后不需要 sudo 或 rvmsudo。

    我建议是用 single-user 模式。

  • 求助,也许是 linux 的问题 at November 14, 2013

    #17 楼 @shangrenzhidao 用 root 安装不是装在 root 下,而是装成 multi-user 模式。我现在都用 single-user 模式了,记不太清楚要怎么弄。

    root 是个特殊的用户,如果搞不清楚的话还是不要用,不过你可以趁机搞明白 root 和 sudo 跟 Linux 用户权限的问题。

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