Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
纯粹
@tiseheaini
VIP
NO. 1189 / 2012-02-24

河北
76 Topics / 585 Replies
8 Followers
0 Following
110 Favorites
经验是从磨练中积累出来的
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 新手求助,诡异的问题新建的 rails3.2.11 项目在 production 下报错,在 development 下正常 at January 12, 2013

    ActionController::RoutingError (No route matches [GET] "/"): 贴出 config/routes.rb 文件看看

  • Rails 应该对 Gems 实行准入许可制度 (转) at January 12, 2013

    很赞同 +1

  • 当个农村大学生真辛苦 at January 06, 2013

    求解!!

  • 一个新的 code refactor 社区 at December 17, 2012

    访问速度很慢,楼主找一下原因吧

  • Rails 使用 mysql 出现问题 at December 17, 2012

    #4 楼 @xautjzd 安装软件的时候都是需要先更新软件源的,我用的是 ubuntu 不知道,fedora 是如何更新,更新完后再安装依赖,然后再安装 mysql

  • link_to 里面嵌套 image_tag 出错。。。 at December 14, 2012
    <%= link_to user_album_photos_path(current_user, album) do %>
      <%= image_tag(album.photos.first.image_url(:littlephoto)) if album.photos.count > 0 %>
    <% end %>
    

    试试这样

  • 用 PHP 实现了一个类似本站的社区 at December 07, 2012

    #6 楼 @leonkaiyu 是呀,好恶心 #8 楼 @zgm

  • 有人有 ror 项目可以合作或者外包吗? at December 06, 2012

    我也是新人,帮顶

  • 求教 在 rails 中使用 ajax at November 30, 2012

    #1 楼 @Rei 谢谢给出指导方向,懂点 js

  • 求教代码 社区里的代码 费解 at November 29, 2012

    #6 楼 @xiaogui 不光 rails 不是新手玩的,连 javascript 也不是新手玩的玩具了

  • 求教代码 社区里的代码 费解 at November 29, 2012

    #4 楼 @xiaogui 这太恶心了,还没 ruby 好用呢

  • 求教代码 社区里的代码 费解 at November 29, 2012

    哦,明白了,原来不是 HTML5 的东西呀,怪不得看着那么奇怪,现在明白了

  • 小团队特征 at November 27, 2012

    很喜欢你的观点,也很喜欢小团队

  • save 总是保存不上 大家帮看一下代码 (结帖) at November 23, 2012

    #13 楼 @Roam 我感觉也没有问题,可就是保存不上,刚才改了,好像可以了,难道这是个坑

  • save 总是保存不上 大家帮看一下代码 (结帖) at November 23, 2012

    #1 楼 @ywencn #6 楼 @woaigithub #9 楼 @cantin 问题解决了,虽然不知道问题出在哪里了 解决方法 开始时 likeable 字段是 string 后来换成了 text 代码也跟着改了

    def likeable                 
        @topic = Topic.last        
        @topicarr = @topic.likeable.to_s.split                                                                                    
    
        @topic.likeable = @topic.likeable.to_s + request.remote_ip.to_s + ' '                                                     
        if @topic.save             
          render :text => @topic.likeable.split.length                                                                            
        else
          render :text => @topic.errors 
        end
      end
    
  • save 总是保存不上 大家帮看一下代码 (结帖) at November 23, 2012

    #9 楼 @cantin 这个方法好坏呀!不过我试过了,也不行 我在写文章的 顶/踩 功能,在 likeable 字段保存用户的 ip 地址 防止重复点击。

  • save 总是保存不上 大家帮看一下代码 (结帖) at November 23, 2012

    #7 楼 @woaigithub @topic.likeable << request.remote_ip.to_s + ' ' 这一行代码 就是更新字段

  • save 总是保存不上 大家帮看一下代码 (结帖) at November 23, 2012

    #1 楼 @ywencn

    1.9.3p125 :016 > t = Topic.last
      Topic Load (6.5ms)  SELECT `topics`.* FROM `topics` ORDER BY `topics`.`id` DESC LIMIT 1
     => #<Topic id: 1, body: "<span style=\"color:#333333;font-size:14px;backgroun...", likeable: "127.0.0.1 127.0.0.1 ", unlikeable: "", timeint: 201211237, created_at: "2012-11-23 05:02:23", updated_at: "2012-11-23 05:24:57"> 
    1.9.3p125 :017 > t.likeable << "127.0.0.2" + " "
     => "127.0.0.1 127.0.0.1 127.0.0.2 " 
    1.9.3p125 :018 > t.likeable
     => "127.0.0.1 127.0.0.1 127.0.0.2 " 
    1.9.3p125 :019 > t.save
       (0.2ms)  BEGIN
       (0.3ms)  COMMIT
     => true 
    1.9.3p125 :020 > Topic.last.likeable
      Topic Load (15.8ms)  SELECT `topics`.* FROM `topics` ORDER BY `topics`.`id` DESC LIMIT 1
     => "127.0.0.1 127.0.0.1 " 
    1.9.3p125 :021 > 
    
    

    在 console 里面也是无法保存成功??

  • save 总是保存不上 大家帮看一下代码 (结帖) at November 23, 2012

    #1 楼 @ywencn

    1.9.3p125 :016 > t = Topic.last
      Topic Load (6.5ms)  SELECT `topics`.* FROM `topics` ORDER BY `topics`.`id` DESC LIMIT 1
     => #<Topic id: 1, body: "<span style=\"color:#333333;font-size:14px;backgroun...", likeable: "127.0.0.1 127.0.0.1 ", unlikeable: "", timeint: 201211237, created_at: "2012-11-23 05:02:23", updated_at: "2012-11-23 05:24:57"> 
    1.9.3p125 :017 > t.likeable << "127.0.0.2" + " "
     => "127.0.0.1 127.0.0.1 127.0.0.2 " 
    1.9.3p125 :018 > t.likeable
     => "127.0.0.1 127.0.0.1 127.0.0.2 " 
    1.9.3p125 :019 > t.save
       (0.2ms)  BEGIN
       (0.3ms)  COMMIT
     => true 
    1.9.3p125 :020 > Topic.last.likeable
      Topic Load (15.8ms)  SELECT `topics`.* FROM `topics` ORDER BY `topics`.`id` DESC LIMIT 1
     => "127.0.0.1 127.0.0.1 " 
    1.9.3p125 :021 > 
    
    

    在 console 里面也是无法保存成功??

  • save 总是保存不上 大家帮看一下代码 (结帖) at November 23, 2012

    #1 楼 @ywencn 数据库里没有插入这条记录 @topic.likeable 没有变化,看 log 信息好像也没有插入这条记录??

  • save 总是保存不上 大家帮看一下代码 (结帖) at November 23, 2012

    #1 楼 @ywencn 没有输出错误 数据库还是没插入成功 不过 log 有一条错误

    Started GET "/topics/likeable" for 127.0.0.1 at 2012-11-23 14:07:52 +0800
    Processing by TopicsController#likeable as HTML
      Topic Load (3.2ms)  SELECT `topics`.* FROM `topics` ORDER BY `topics`.`id` DESC LIMIT 1
       (2.6ms)  BEGIN
       (1.4ms)  COMMIT
      Rendered text template (0.0ms)
    Completed 200 OK in 11ms (Views: 0.7ms | ActiveRecord: 7.2ms)
    [2012-11-23 14:07:52] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
    
  • RubyConfChina 2012 问卷调查数据汇总 at November 23, 2012

    #3 楼 @lgn21st #2 楼 @chunlea 河北的也是一票,我独占了

  • SAE 的 Ruby 平台邀请码现场发放,算不算福利? at November 14, 2012

    RubyConfChina 福利好多呀

  • Rails Tutors 中文班开班了 at November 13, 2012

    辛苦了,中文课程对新人友好一些,不过貌似大家不亢奋

  • RubyConfChina 2012 门票转让 (已处理) at November 12, 2012

    #7 楼 @aabbcc456aa 我的邮箱 [email protected]

  • RubyConfChina 2012 门票转让 (已处理) at November 12, 2012

    #10 楼 @lgn21st 我好惭愧,我技术很差,而且没为社区做过贡献,应该感谢你,感谢社区的贡献者

  • RubyConfChina 2012 门票转让 (已处理) at November 12, 2012

    #10 楼 @lgn21st 我好惭愧,我技术很差,而且没为社区做过贡献,应该感谢你,感谢社区的贡献者

  • RubyConfChina 2012 门票转让 (已处理) at November 12, 2012

    #8 楼 @lgn21st #7 楼 @aabbcc456aa 我要平反,我是不想给组织者添麻烦才决定的。组织者那么不容易,不应该把精力浪费在这种杂事上。

  • RubyConfChina 2012 门票转让 (已处理) at November 12, 2012

    #5 楼 @lgn21st #4 楼 @aabbcc456aa 好吧,那我就要了 我的邮箱 [email protected]

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