Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
@messiahxu
VIP
NO. 481 / 2011-12-15

南京
2 Topics / 229 Replies
1 Followers
0 Following
90 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Terminal 里面 Vim 如何多行复制粘贴代码 at June 08, 2014

    yy 本来就是只复制光标所在行的…… 要复制多行,直接选中之后 y 就好。

  • 问个传递参数的问题,新手问题 at June 05, 2014

    #9 楼 @yeyong14 http://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations 看一下这部分。

  • 问个传递参数的问题,新手问题 at June 05, 2014

    #9 楼 @yeyong14 其实不会很慢的,省市多你可以一次全部读出来,然后在自己按省市时间分组啊。

  • 问个传递参数的问题,新手问题 at June 05, 2014

    #5 楼 @yeyong14 手写很困难吗…… 把查询包装成 helper 就是了,这样自己改起来还方便。

  • 问个传递参数的问题,新手问题 at June 05, 2014

    #3 楼 @yeyong14 那就按时间读取呗。

    product.provinces.where(created_at: Time.now.beginning_of_month..Time.now)
    

    这样。。。

  • 问个传递参数的问题,新手问题 at June 05, 2014

    表述清楚先啊

  • 表关联查询.大神进 at May 28, 2014
    Ip.joins("inner join users on users.id = ips.update_user_id").order("users.user_name asc")
    

    这样?

  • Rails 4 数据关联问题 at May 17, 2014

    应该是@user 吧

  • [已解决] 如何创建 PostgreSQL 的数据库 at May 08, 2014
    create role yby with createdb login password 'password'
    
  • 在 application.html.erb 中引入 css 出错,忘高手帮忙给看看 at May 01, 2014

    gem 'sass-rails', '~> 4.0.2'

  • Array 的创建 at April 27, 2014

    并行赋值。 当只有一个左值但是有多个右值时,Ruby 会创建一个数组来容纳所有右值,并且将这个数组赋给左值。

  • 病马寻良医,SessionHelper 错误 ! at April 13, 2014

    文件名 sessions_helper.rb

  • [求教] 如何有趣地表达、写作? at April 05, 2014

    #1 楼 @chairy11 是的,需要一帮代笔才可以……

  • 疯了,kaminari,显示不了内容 at March 26, 2014

    #2 楼 @soft_war

    <%= paginate(@user) %>
    

    这段的作用只是显示一个分页的链接而已,具体的显示内容你还是要自己写的。

  • 多层嵌套路由怎么处理啊? at March 25, 2014

    不建议又不是不支持

  • check_box_tag 怎么修改后并没有更改数据库中的数据 at March 13, 2014

    controller 贴出来看看

  • 快速生成一个 [1,2,3,4,5,6,7,8,9,10] 的数组 at March 12, 2014

    Array.new(10).fill{|i|i+1}

  • 二个 rails 项目共用一个数据库 at February 17, 2014
    remote_database:
      adapter: mysql2
      encoding: utf8
      host: xxx.xxx.xxx.xxx
      pool: 5
      username: "xxx"
      password: "xxx"
      database: xxx
    
    class User < ActiveRecord::Base
      establish_connection "remote_database"
    end
    
  • [奖品图曝光] UPYUN 送上情人节三件套,祝大家码上有爱情 at February 11, 2014

    这一排邮箱是在求种吗……

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