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

[email protected]
深圳
182 Topics / 9132 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
  • 提个疑问,请过来人帮忙确认下,这是否是书籍中的疏漏,针对 Agile Web Development with Rails,4rd Edition ,P132 at May 12, 2012

    我翻了翻中文版,你的例子在 91 页,我往回翻了翻,在 81 页看到 store 的页面模板,有大概这条内容

    depot_f/app/views/store/index.html.erb

    <% if notice %>
      <p id="notice"><%= notice %></p>
    <% end %>
    

    这应该是拿来显示 notice 的。

  • 对象的属性名称是变量,怎样处理? at May 10, 2012
    object.send :name
    object.send :value
    
  • Rails3 中的表单 AJAX 提交怎么写啊! at May 10, 2012

    http://chloerei.com/2012/04/21/rails-3-2-ajax-guide/

  • [已解决] Rails 多版本安装后的怪问题 at May 09, 2012

    应该是把 source ~/.rvm/scripts/rvm 写到 .bashrc 最后,然后开新的 shell

    我最近用 kubuntu 装了一次,好像 .bash_profile 不起效

  • 问一下,ITeye 的 night_stalker 在咱们这个坛子里吗? at May 08, 2012

    哈哈

  • 系統帳號認證錯亂問題 at May 07, 2012

    #21 楼 @hSATAC 应该是我抱歉闲置了这个 bug 这么久,今晚重构一下三方登录的代码 : )

  • 请教,Rails 项目中调用 WebService 用什么? at May 07, 2012

    是指 soap? https://www.ruby-toolbox.com/categories/soap

  • 忘記密碼功能會發生錯誤 at May 07, 2012

    在这里提更好 https://github.com/ruby-china/ruby-china/issues

    这个问题已关注,多谢反馈。

  • Ruby China T 恤 宝雷杭团队 at May 07, 2012

    X 战警!

  • 系統帳號認證錯亂問題 at May 07, 2012

    #19 楼 @dqaria 也许找到问题所在(之一)了 https://github.com/ruby-china/ruby-china/commit/01a04f76c0e0d56d30ebf57028909d3fad26e81b

    根据你的 github id,在终端里手工给你绑到原帐号了,重登录试试。

  • Rails 3.2 的 Ajax 向导 at May 06, 2012

    #13 楼 @reducm 我试了一下 coffee.erb,不能正确处理,后来就把文中 coffee 部分内容去掉了。

    #14 楼 @quakewang 因为假设的例子是 :remote => true 这个 Rails 的 helper 都不用,所以用了 submit 事件发起 ajax 请求。也许例子二和一混淆了,我再补充一个例子二的 form。

  • 系統帳號認證錯亂問題 at May 06, 2012

    @cactis 的帐号异常,绑定了 3 个帐号,现在我把另外两个绑定删了。账户错误的朋友请登出一下。

    如果另外两个人从刚注册就绑定了错误帐号,那么实际上没有注册 ruby-china 帐号,要再注册一次。

    如果另外两人是有 ruby-china 帐号的,并且能用密码登录,可以登录后再绑定 github。(http://ruby-china.org/account/edit)

    如果是有 ruby-china 帐号,github 是唯一登录途径,那么可以使用找回密码功能,重设密码后重新绑定。

  • 多条查询如何使用 模型内在的分页?(比如 Kaminari) at May 05, 2012

    many-to-many 的话

    user.messages.page(params:page]).per(5) 
    
    

    就行了

  • Linux 下有比较好的 SSH 工具么? at May 05, 2012

    直接 ssh 不就好了

  • 多条查询如何使用 模型内在的分页?(比如 Kaminari) at May 05, 2012

    LZ 的例子查询结果是关联表的内容,我很疑惑这个查询的目的啊。

    User 和 Messages 的关系是 has_many 还是 has_and_belongs_to_many?一般状况用不着写 SQL 啊。

  • 多条查询如何使用 模型内在的分页?(比如 Kaminari) at May 05, 2012

    #6 楼 @lin_style

    1. 是的
    2. 分页是用 limit, offset
    3. includes 是 ActiveRecord 中辅助多表查询的方法,除了 includes 还有 joins,区别是 select 部分不同。
  • 请问异步 ajax 的通知是怎么实现的? at May 04, 2012

    即时性要求不高的用 Ajax 轮询,也就是 js 定时访问

  • 当一个 gem 在 rubygem.org 可以搜到,但是在 Rails 中安装这个 gem 时,却提示找不到 at May 04, 2012

    search for rmgick No entries found

  • 多条查询如何使用 模型内在的分页?(比如 Kaminari) at May 04, 2012

    #4 楼 @lin_style

    1. 你的需求其实可以用 includes 解决
    2. 纯 SQL 的时候,用 limit 和 offset 语句来实现分页
    3. paginate_array 传入 limit, offset, total_count 参数生产一个 PaginateArray 对象,是拿来给 paginate helper 用的。
  • 多条查询如何使用 模型内在的分页?(比如 Kaminari) at May 04, 2012
    # Wrap an Array object to make it paginatable
    # ==== Options
    # * <tt>:limit</tt> - limit
    # * <tt>:offset</tt> - offset
    # * <tt>:total_count</tt> - total_count
    def self.paginate_array(array, options = {})
      PaginatableArray.new array, options
    end
    
    

    https://github.com/amatsuda/kaminari/blob/master/lib/kaminari/models/array_extension.rb

  • 关于下一版本 Ruby China 的功能计划 at May 03, 2012

    以前做过一次 Timeline,不赞成做,Timeline 只需要 Twiitter 就够了。

    论坛最与众不同的地方就是可以看到意想不到的内容,follow 机制会导致视野越来越窄。

    目前内容展示的缺陷是低质内容(不经思考的提问、扯淡)过多,解决方案我赞成之前 @saito 提的首页用排序算法,只想阅读高质内容的可以只看首页,类似 hacknews。而喜欢扯淡的再点进主题列表页。

  • 安装 mysql2 gem 时出问题, *** extconf.rb failed *** at May 03, 2012

    sudo apt-get install libmysqlclient-dev

  • rails ajax 问题请教 at May 01, 2012

    #10 楼 @xoxoj jbuilder

  • rails ajax 问题请教 at May 01, 2012

    #5 楼 @xoxoj type 换 get 试试

  • 请教 MongoDB 结构问题 at April 30, 2012

    公司,部门,员工三个 Model,has_many 关系。

  • rails 如何做动态限时下载链接呢? at April 30, 2012

    #3 楼 @anylei http://apidock.com/rails/ActionController/Streaming/send_file 现在应该会自动用 X-sendfile 了,由静态服务器处理文件发送。我还没试过

  • rails ajax 问题请教 at April 29, 2012

    LZ 需要了解 respond_to 这个 api 和 :json format 的关系。

    http://apidock.com/rails/ActionController/MimeResponds/respond_to

    额外要做的是在布局里面的 head 部分加上<%= csrf_meta_tags %>,还有 jquery_ujs.js,用来给每个 ajx 请求加上防跨域攻击的 token。

    Rails 跟传统的 js 方式结合很好,其实它本身就是很标准的。

  • (转槽帖) Dear Python, Why Are You So Ugly? at April 29, 2012

    octopress 可以做反面例子

  • 表单与 mass-assign 的矛盾怎么解决比较优雅 at April 28, 2012

    http://apidock.com/rails/ActiveRecord/Persistence/update_attributes

    现在有 without_protection 这个参数了

    再配合 params[:xxx].slice(...) 来用

  • Rails 3.2 的 Ajax 向导 at April 28, 2012

    #9 楼 @huacnlee 不换头像不舒服斯基

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