Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
@kamechen
高级会员
第 184 位会员 / 2011-11-23

3 篇帖子 / 18 条回帖
0 关注者
0 正在关注
3 收藏
GitHub Public Repos
  • area_cn 8

    中国地区数据查询

  • jquery.deletable 2

    jquery.deletable used in use case that want to delete an item in a table or list via ajax

  • words-about-code 2

    My technical blog

  • headlessui 1

    Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailw...

  • prettier 1

    Prettier is an opinionated code formatter.

  • ngx-virtual-scroller 1

    Virtual Scroll displays a virtual, "infinite" list.

  • dotfiles 1

    A set of vim, zsh, git, and tmux configuration files.

  • ng-devui 1

    Angular UI Component Library based on DevUI Design

  • message-demo 1

    message stream demo in angular

  • common-abbreviations-I... 1

    common abbreviations in English,常见英文缩写

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • will_paginate 分页问题 at 2014年11月03日

    #10 楼 @dgy1126 我想你要的也就是页面上分页的实现吧,后台数据听你这意思是已经支持分页的查找了,取回的都是分页的数据,那何必一定要用 will_paginate 呢,你可以自己实现一个 view helper 来做分页的事情嘛,controller 中都不需要对你的 array 做什么操作

  • 开源 Tower 的编辑器 Simditor at 2014年03月31日

    :plus1:

  • Rails 4 的 Observer 为什么会去掉? at 2013年12月13日

    我觉得这个解释比较好 http://blog.remarkablelabs.com/2012/12/observers-gem-extraction-rails-4-countdown-to-2013

  • Grape 如何实现不需要重启服务器,自动编译 reload at 2013年11月19日

    #13 楼 @lytsingsun 不好意思,是我弄错了,我们那个也是在 Rails 4 的版本下做的,Rails 3 下还不支持自动 reload,在 Rails 3 下要解决这个问题,14 楼 @shawnyu 的方法应该可以,17 楼 @Victor 说的 shotgun 也是可以的,只是 shotgun 可能会比较慢

  • Grape 如何实现不需要重启服务器,自动编译 reload at 2013年11月18日

    #11 楼 @lytsingsun App 是我们自己定义的一个类,在 app/api 目录下,类似下面这样

    class App
      def self.instance
        @instance ||= Rack::Builder.new do      
          use Middlewares::Logger, Api.logger
          run Api
        end.to_app
      end
    end
    

    这个只是用来加入一些 middleware 的,如果你不需要,你也可以直接吧 App.instance 换成你的 Api

  • Grape 如何实现不需要重启服务器,自动编译 reload at 2013年11月18日

    #5 楼 @huacnlee 一定需要 rails 4?3 不行?

  • Grape 如何实现不需要重启服务器,自动编译 reload at 2013年11月18日

    #2 楼 @lytsingsun 3.2 也是可以的啊,放在 app/api 下本来就是可以的,在 application.rb 中加上

    config.autoload_paths += %W(#{config.root}/app/api)
    

    我们的做法是这样的:

    config.ru 文件中设置

    if Rails.env.production?
      map '/api' do
        run App.instance
      end
    end
    

    routes.rb 文件中设置

    mount App.instance => '/api' unless Rails.env.production?
    

    App.instance 是一个包装的 rack app,可以加一些 middleware

    这样在生产环境下就可以直接到 api,不用走 rails 这一层,在开发环境下走 rails,这样代码也可以自动加载,更新。

  • Description,一个通过分析 ActiveRecord::Migration 文件提取数据库文档的工具 at 2013年08月31日

    great tool

  • 模型间的关系 at 2013年03月01日

    多态啊,在 Note 上添加 notable_id, notable_type 两个属性,声明 belongs_to :notable 就行了,在 Company, Task, Opunity 里添加 has_many :notes, as: :notable 就可以了

  • 这种情况该如何设计 resources 和 route ? at 2013年02月28日

    #2 楼 @jock

    resouces :posts do
      resources :photos 
      resources :comments
    end
    resources :photos do
      resources :comments
    end
    
  • whenever 定时执行一个 model 里面的方法,rails ,怎么运行呢? at 2013年02月28日

    #5 楼 @ginchenorlee 检查下 你的 linux 有没有安装 crond 这个服务

  • Rails is omakase - 中文版 at 2013年01月17日

    楼主真系好人,英文还不到看这么多比喻的文章,感谢感谢。

  • gem 推荐:better_errors at 2012年12月13日

    早上也看到这个 GEM,用了,感觉定位问题更显性点,还不错的,也能在页面里直接 console debug。

  • 有没有用过 RefineryCMS 的朋友,帖子如何分组并展示呢? at 2012年07月19日

    @siyang1982 如果你只想在页面上 分栏目显示,你可以用用 cells 这个 GEM,https://github.com/apotonick/cells

  • [杭州][2012年04月17号] Ruby Tuesday 在大浪 at 2012年04月16日

    顶一个,明天来参加

  • 请问 ruby rails 中,realtime 功能有什么工具可以做?都用 faye 吗? at 2012年02月03日

    #1 楼 @allenwei 恩,试试看,现在在试用 faye

  • rails 生产环境下的日志问题 at 2011年12月25日

    #2 楼 @camel 开始是用 Log4r,后来发现在多进程的情况下,也存在日志切分问题,会被覆盖;才换了 RUBY 本身的日志,后来又发现 RUBY 本身的在进程下也有问题,呵呵!还是 Logrotate 比较好!

  • rails 生产环境下的日志问题 at 2011年12月25日

    #1 楼 @lgn21st 恩,是的,发现 logrotate 非常好,那就不需用自带的日志切分了,谢谢!

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