Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Eric-Guo
@ericguo
VIP
NO. 1665 / 2012-03-31

eric.guocz@gmail.com
天华建筑设计
上海
46 Topics / 1375 Replies
181 Followers
244 Following
74 Favorites
选Ruby是符合我爱钱爱金爱宝石气质的…
GitHub Public Repos
  • wechat 1327

    API, command and message handling for WeChat in Rails

  • wechat-starter 351

    WeChat web app with wx_pay in rails

  • tailwindcss-jit-stimulus 19

    A template with Rails 7.1, Shakapacker 7.2, TailwindCSS 3 and Stimulus 3.0

  • coreui4-rails-starter 12

    The CoreUI 4 Rails starter

  • pgac_demo 11

    Rails 7.2 Action Cable chat room using AnyCable as backend

  • product_hunt 5

    Demonstrate new Rails 5.1 feature: Assets on Yarn, System tests with Capybara and unified form_wi...

  • openproject 2

    OpenProject is the leading open source project management software.

  • dify-ruby-sdk 2

  • homeland 1

    :circus_tent: An open source forum/community system based on Rails, developed based on Ruby China.

  • openproject-proto_plugin 1

    Exemplary OpenProject plugin demonstrating different ways to extend OpenProject.

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • The Pragmatic Bookshelf 的优惠码又来了 at November 24, 2015

    Deliver Audacious Web Apps with Ember 2,9 美刀,便宜啊便宜!

  • 在 Windows 环境下安装 unicorn gem 包出错 at November 23, 2015

    Windows 推荐 puma,unicorn 从来就是不支持的。

  • Teahour.FM #81 和微软的爱恨情仇 at November 19, 2015

    #14 楼 @yzdel2000 好的,我错了,PHP 是最佳语言。。

  • 如何研究一个 Gem 包? at November 19, 2015

    #19 楼 @so_zengtao 多谢,这个 gem 确实入门不错,关键简单,但又不是太简单。。

  • Teahour.FM #81 和微软的爱恨情仇 at November 17, 2015

    #8 楼 @yzdel2000 确实 5.6 还是支持的,不过貌似 7.0 的确没有,对 PHP 不熟,只是随口一说,听众眼睛雪亮啊!

  • 准备着手翻译出版《Rebuilding Rails》,有人愿意买吗? at November 17, 2015

    买买买!

  • 关于 Rails 的动态模型,不重启服务器是不是不能更新呢? at November 13, 2015

    #7 楼 @yan32768 6 楼已经是正解,还有高手不是天天给你回答问题的,你这样说话很容易引起别人反感。

  • Rails 4 新项目的选择 2:前端框架 Simple_form 后台任务 搜索和用户认证 at November 08, 2015

    client_side_validations总算又活了,之前粗粗看过这个,感觉想用好很难,对开发者的 rails 和 coffee script 能力都有要求。

  • AJAX 使用 format.js 和 format.json 的区别以及问题 at November 07, 2015

    #3 楼 @chaucerling 当然不值得,不过现实的问题是先有了简单的页面 DOM 更新,然后你就会碰到复杂的,然后越搞越复杂,直到某一个点,你强烈的感到其实这已经是 SPA 了。。。

  • AJAX 使用 format.js 和 format.json 的区别以及问题 at November 05, 2015

    Rails 鼓励使用 format.js,因为渲染的 html 可以同后端共享,rails_ujs,turbolink 的支持也好。当然缺点也明显,前端后端不分离,完全的 Rails 解决方案绑定,后期不利于进行 micro-service 化。

    format.json 的话,必然搭配前端框架,ember 配ams其实是目前成熟度最高的,也是除了除了 format.js 最偏 rails 的,其实越是纯 json,对 rails 的依赖越少,其实用 rails 的意义就越小。

    format.json 对前端框架的选择,react-rails或者vue.js,目前是比较火的,但是就没有 ams 这样的 declative gems 了,一般都需要用 jbuilder 进行输出。

  • 「我们中出了一个叛徒」Shou.TV 从 Rails 切到 Go 了 at November 05, 2015

    应该恭喜才对,说明产品进入稳定期了。

  • 关于 Slim 模板的`=`标记的疑问 at November 02, 2015

    #2 楼 @hxygsh 就是写=> 后面会多加一个空格,看输出的页面很容易验证。

  • React vs Ember by Alex Matchneer at EmberNYC meetup at November 01, 2015

    #11 楼 @wppurking 两个框架都有优秀的地方,react-native毕竟 FB 也是敢想敢干啊,都学吧。。

  • 生产环境下,rake assets:precompile 后出现 TypeError: unknown filter type 错误 at November 01, 2015

    #2 楼 @zorajiang 其实应该使用这个分支:https://github.com/javyliu/rails_kindeditor,不过看起来这个编辑器好久没人更新了。。

  • React vs Ember by Alex Matchneer at EmberNYC meetup at November 01, 2015

    #2 楼 @aidewoode 同意,你的这篇vue.js 使用感受写的不错。

  • 在 Model 中使用 routes helper at October 30, 2015

    #5 楼 @billy 准确的说是 foo_url(@some_model),不过坑爹的是 url routes helper 无法在 model 里面使用。

  • Ruby 菜鸟代码拍砖 at October 29, 2015

    write 部分可以简化一点吧?

    def magic_change(file)
      # read file
      return unless File.exist? file
      original_string = IO.read(file, encoding: 'GBK').encode!('UTF-8')
      # deduplicate characters
      original_string = original_string.gsub(/([\S]{4,})\1/) { Regexp.last_match[1] }
      # write file
      File.write('b.txt', original_string, external_encoding: Encoding::UTF_16LE)
    rescue => error
      p error
    end
    
    magic_change ARGV[0]
    
  • 在 Model 中使用 routes helper at October 29, 2015

    #1 楼 @billy 还是有场景的,比如模型里面写发邮件的方法,邮件里面希望使用链接。

  • Volt 可以应用的生产环境吗? at October 27, 2015

    好像还不支持连接数据库?这样怎么用于生产啊。。

  • [上海][2015年10月27日] Ruby 聚会召集 at October 27, 2015

    @ibachue 的how-to-exec-shell-in-ruby 真不错,学到很多。

  • 新手关于 Ruby 的一个疑问 at October 26, 2015

    #1 楼 @although13 正解。

    [3] pry(main)> show-source File#open
    
    From: io.c (C Method):
    Owner: Kernel
    Visibility: private
    Number of lines: 36
    
    static VALUE
    rb_f_open(int argc, VALUE *argv)
    {
        ID to_open = 0;
        int redirect = FALSE;
    
        if (argc >= 1) {
            CONST_ID(to_open, "to_open");
            if (rb_respond_to(argv[0], to_open)) {
                redirect = TRUE;
            }
            else {
                VALUE tmp = argv[0];
                FilePathValue(tmp);
                if (NIL_P(tmp)) {
                    redirect = TRUE;
                }
                else {
                    VALUE cmd = check_pipe_command(tmp);
                    if (!NIL_P(cmd)) {
                        argv[0] = cmd;
                        return rb_io_s_popen(argc, argv, rb_cIO);
                    }
                }
            }
        }
        if (redirect) {
            VALUE io = rb_funcall2(argv[0], to_open, argc-1, argv+1);
    
            if (rb_block_given_p()) {
                return rb_ensure(rb_yield, io, io_close, io);
            }
            return io;
        }
        return rb_io_s_open(argc, argv, rb_cFile);
    }
    
  • 為什麼要 Bundle Update? at October 13, 2015

    #11 楼 @winstonyw 我就是天天 bundle update,但是,恩,恕我直言,感觉 deppbot 这门生意很难收到钱,因为无法帮助我了解每个 gems 的更改情况,升级了,我肯定还是会第一时间看 gem 的 changelog,然后按照相应指示改代码或者跑测试(实际上是开发时候顺便跑),总之,真的不觉得麻烦,还能顺便刷个论坛呢。。

  • Rails 如何调用.NET 的 WCF 接口 at October 13, 2015

    #8 楼 @psvr grape好像有人说过单单 host 比和 rails 还慢,还有目前 intridea 又不维护,看来看去还是 AMS 靠谱点,不知道你怎么看。 #14 楼 @mumu 你也问得太 general 了吧,这样的问题感觉就是伸手党,ruby 社区不欢迎这样的提问方式。

  • Rails 如何调用.NET 的 WCF 接口 at October 13, 2015

    #12 楼 @mumu jbuilder是 gem,Borland JBuilder 都不知道死了多少年了。。

  • Rails 如何创建 WebService 接口,提供给 .NET 程序调用 at October 13, 2015

    另外现在语言和平台之间的互操作协议,json 相比 SOAP 早就一统江湖啦,唯一的争议是到底 json 格式语义如何定义,GraphQL/jsonapi,其实就是选 react 还是 ember.js,但无论如何前后端分离肯定是趋势,如果喜欢 Rails 的话 Rails 5 API 里面推荐的官方 gem 是AWS,其实换句话说,Rails 官方也给你选了,就是 jsonapi+ember.js 的方案。

    所以我现在 focus 这两个技术,一个就是 ember.js,另外就是 rails 5。其他 wdsl, Thrift, Protobuf 特定场合特定技术吧,未来 Rails 主流应该还是 jsonapi。

  • Rails 如何创建 WebService 接口,提供给 .NET 程序调用 at October 13, 2015

    #9 楼 @jimrokliu 同意,如果是 rails 的话,应该提供 json 格式的 restful 风格的 API 给其他平台调用,提供 web service 简直是扬短避长,.NET 这边调用 json 的话,虽然麻烦点,但也能接受,比如这样:

    using (WebClient client = new WebClient())
    {
        string url = string.Format("http://10.71.5.88/forms/real_time_broadcasts/{0}/confirm_speaked.json", say.confirm_speaked_id);
    
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
    
        request.Method = "POST";
        request.Timeout = 5000;
        request.ReadWriteTimeout = 10000;
    
        request.Accept = "application/json";
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        StreamReader reader = new StreamReader(response.GetResponseStream());
        string htmldoc = reader.ReadToEnd();
        response.Close();
    }
    
  • Rails 如何调用.NET 的 WCF 接口 at October 12, 2015

    #6 楼 @mumu 最官方的是用 jbuilder,返回 json 对象给.NET/Java 使用。

    using Newtonsoft.Json;
    
    string strlot = jsonLotInfo("M1516M8177");
    var lot = JsonConvert.DeserializeObject<dynamic>(strlot);
    Console.WriteLine(string.Format("Product: {0}", lot.product.product_name));
    Console.WriteLine(string.Format("POD: {0}", lot.product.package_of_drawing.name));
    foreach (var wfs in lot.workflow.workflowsteps)
    {
        Console.WriteLine(string.Format("  Step: {0}", wfs.workflowstepname));
    }
    
    private static string jsonLotInfo(string lot_no)
    {
        String ret = String.Empty;
    
        HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(new Uri(string.Format("http://mesview.sandisk.com/lots/{0}.json", lot_no)));
        webReq.ContentType = "application/json; charset=UTF-8";
        webReq.Accept = "application/json";
        webReq.Timeout = 30000;
        HttpWebResponse response = (HttpWebResponse)webReq.GetResponse();
        StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.Default);
        ret = sr.ReadToEnd();
        sr.Close();
        response.Close();
    
        return ret;
    }
    
  • 為什麼要 Bundle Update? at October 12, 2015

    #5 楼 @billy 这太夸张了,我和你完全相反,每天都做 bundle update,因为应用始终跑在最新版。。

  • Rails 如何调用.NET 的 WCF 接口 at October 08, 2015

    用 savon,别用内置的 soap/wsdlDriver,这个在 Ruby 新版本已经去除了

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