Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Siad
@dume2007
会员
第 8458 位会员 / 2013-08-01

9 篇帖子 / 32 条回帖
0 关注者
0 正在关注
0 收藏
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 求助 rewrite 规则一个?? at 2013年12月23日

    解决了~

    set $sub_domain “”;
    if ( $host ~* (.*)\.baidu\.com ){
        set $sub_domain $1;
    }
    if ( $sub_domain != “www” ){
        rewrite ^/([a-zA-Z]+)(\d+)/(\w+).html$ /index.php?domain=$sub_domain&page=$1&size=$2&id=$3 last;
    }
    
  • 像我这 at 2013年12月17日

    #38 楼 @Yujing_Z 哈哈

  • 求助 rewrite 规则一个?? at 2013年12月16日

    #4 楼 @sandtears 应该要反一下,操作的 host 是对所有非 ^www.aa.com 的域名

  • 求助 rewrite 规则一个?? at 2013年12月16日

    #2 楼 @Ryn 你确定?

  • 求助 rewrite 规则一个?? at 2013年12月16日

    有人会麽?

  • 像我这 at 2013年12月16日

    选择 php 做网站我觉得更快速!尤其用框架,自动生成神马的,php 都有!

  • 迅雷白金会员双 11 5 折优惠了 有需要的去买吧 at 2013年11月05日

    我用旋风离线已经能满足要求了~

  • 迅雷白金会员双 11 5 折优惠了 有需要的去买吧 at 2013年11月05日

    我家网速最高 60k,我买了会员后下载能到 600k 麽?

  • 求教 rails 如何调试? at 2013年11月05日

    #10 楼 @david_he rails s,有时候是用 RubyMine 启动工具

  • 求教 rails 如何调试? at 2013年11月01日

    #6 楼 @putty 在 development.rb 下需要配置什么参数?我的是:

    JazzHands::Application.configure do
      # Settings specified here will take precedence over those in config/application.rb
    
      # In the development environment your application's code is reloaded on
      # every request. This slows down response time but is perfect for development
      # since you don't have to restart the web server when you make code changes.
      config.cache_classes = false
    
      # Log error messages when you accidentally call methods on nil.
      config.whiny_nils = true
    
      # Show full error reports and disable caching
      config.consider_all_requests_local       = true
      config.action_controller.perform_caching = false
    
      # Don't care if the mailer can't send
      config.action_mailer.raise_delivery_errors = false
    
      # Print deprecation notices to the Rails logger
      config.active_support.deprecation = :log
    
      # Only use best-standards-support built into browsers
      config.action_dispatch.best_standards_support = :builtin
    
      # Raise exception on mass assignment protection for Active Record models
      config.active_record.mass_assignment_sanitizer = :strict
    
      # Log the query plan for queries taking more than this (works
      # with SQLite, MySQL, and PostgreSQL)
      config.active_record.auto_explain_threshold_in_seconds = 0.5
    
      # Do not compress assets
      config.assets.compress = false
    
      # Expands the lines which load the assets
      config.assets.debug = true
    end
    
  • 求教 rails 如何调试? at 2013年11月01日

    #4 楼 @xjz19901211 用这个 Rails.logger.info('xxx'),在 rails s 后面的滚动日志列表里还是看不到任何信息,这跟环境有关系?还是 rails s 后要加什么参数?

  • 求教 rails 如何调试? at 2013年11月01日

    #1 楼 @david_he puts 后在哪里可以看到?网页上没显示,server log 也没有啊?

  • 有哪些代码质量比较高的、值得学习的开源项目? at 2013年11月01日

    最好有简单的 CURD 操作的开源代码,我就想看看高手是如何读写数据库的,有木有? 当然不是脚手架生成的那么简单的~

  • 求助 Gemfile 中配置通过 git 节点获取数据,bundle Install 不成功? at 2013年10月31日

    #4 楼 @Rei 我把这个 Gem 注释掉了,bundle Install 成功。不过启动后浏览出现问题,不知道跟这个 gem 有没有关系啊?

  • 求助 Gemfile 中配置通过 git 节点获取数据,bundle Install 不成功? at 2013年10月31日

    #1 楼 @Rei

  • Ruby 给一组对象赋新值,不得其领啊?求助~~ at 2013年10月24日

    #2 楼 @Rei 那个请问下要在 Controller 或 model 里直接 puts 没有效果,要想中断该如何操作?

  • Ruby 给一组对象赋新值,不得其领啊?求助~~ at 2013年10月24日
    def self.get_cate_news(categories = [])
        ret = []
        categories.each do |item|
          img = self.get_news_list(false, false, "n.classid = '#{item.id}'", 'n.id desc', '2', '0')
          hot = self.get_news_list(false, false, "n.classid = '#{item.id}' and imgurl<>''", 'n.id desc', '12', '0')
          ret.append({:id => item.id, :classname => item.classname, :img => img, :hot => hot})
        end
        ret
      end
    

    只能这样了~

  • Ruby 给一组对象赋新值,不得其领啊?求助~~ at 2013年10月24日

    undefined method `img=' for GgClasslist id: 1, classname: "穿越小说" item 不就是一个 hash 对象吗?它本身有 id,classname 两个 key,我们怎么不能新增 key?

  • Rails 帮我看看我这种写法有没有问题? at 2013年10月24日

    #20 楼 @liwei78 这个方法我是用原生 sql 执行的,判断比较多,直接用 AR query,不好操作~

  • Rails 帮我看看我这种写法有没有问题? at 2013年10月24日

    #11 楼 @_samqiu #14 楼 @liwei78 不过为什么编辑器还有提示呢?虽然没错误~

  • Rails 帮我看看我这种写法有没有问题? at 2013年10月24日

    #15 楼 @_samqiu #14 楼 @liwei78 领教了,多谢哈!!!一段代码带出这么多问题,还是有收获的~

  • Rails 帮我看看我这种写法有没有问题? at 2013年10月24日

    #11 楼 @_samqiu 经测试,model 里的自定义方法还是要多个 new 的

  • Rails 帮我看看我这种写法有没有问题? at 2013年10月24日

    #10 楼 @chucai

    def index
        @class = GgClasslist.all
        @ask_list = GgNewsAsk.new.get_ask_list(10)
        @day_count = GgNews.new.day_count
        @new = GgNews.new.get_news_list(false, false, "1=1", "n.id desc", "30", "0")    
      end
    

    我改成这样了,工具现在不提示了~ 写法是否符合?

  • Rails 帮我看看我这种写法有没有问题? at 2013年10月24日

    #7 楼 @chucai

    def index
        obnews = GgNews.new
        obask = GgNewsAsk.new
    
        @class = GgClasslist.all
        @ask_list = obask.get_ask_list 10
        @day_count = obnews.day_count
        @new = obnews.get_news_list false, false, "1=1", "n.id desc", "30", "0"    
      end
    

    我改进了,不过其它还要改么?编辑器一直有提示~但不是错误·

  • Rails 帮我看看我这种写法有没有问题? at 2013年10月24日

    #4 楼 @Shadow #2 楼 @liwei78 怎么写才好啊?

  • Rails 帮我看看我这种写法有没有问题? at 2013年10月24日

    #4 楼 @Shadow 😅

  • Rails 帮我看看我这种写法有没有问题? at 2013年10月24日

    #2 楼 @liwei78 功能很简单,就读取数据库, @class是读取所有栏目, @ask_list读取问答表的前 10 条数据 @day_count是统计今天更新的数据量 @new是获取前 30 条新闻数据 前面 3 个是 model,所有方法都写在 model 里~

  • Ruby 如何将时间戳转换为日期格式? at 2013年10月23日

    OK,解决~ http://stackoverflow.com/questions/10331926/ruby-convert-unix-timestamp-to-date http://stackoverflow.com/questions/7816365/how-to-convert-a-unix-timestamp-seconds-since-epoch-to-ruby-datetime

  • Rails 如何对已有的数据表建立相应的 Model? at 2013年10月21日

    嗯 我用了 2 楼 Reverse engineering 工具生成的也是#4 楼 @oldfritter 产生的格式~

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