Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
郭雄伟
@littleluren
Member
NO. 5166 / 2013-01-07

[email protected]
上海未来宽带技术股份有限公司
上海
0 Topics / 17 Replies
0 Followers
1 Following
3 Favorites
sometimes, the best word is silence!
GitHub Public Repos
  • kxmovie 18

    kxmovie for vcam

  • gLastpass 6

    lastpass client with swift

  • 94hotel 1

    map library

  • DownloadManager 1

    视频下载(断点下载), 播放

  • lastpass 1

    lastpass client with object-c

  • window 0

    test lr request header

  • ios-webpacker-source 0

  • JPVideoPlayer 0

    Automatic play video & cache video data in UITableView like Weibo and Douyin.

  • cascading-dropdown 0

    Cascading form drop-down menus

  • bootstrap-select 0

    :rocket: The jQuery plugin that brings select elements into the 21st century with intuitive multi...

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • [上海] “来了 100” 欢迎爱好 Ruby,好学上进的你加入 at July 18, 2019

    希望 Ruby 做强做大!

  • [上海] “来了网” 欢迎爱好 Ruby,好学上进的你加入 at April 09, 2018

    顶一个,希望 ruby 越来越大

  • 重写 Gem 的某些 helper 方法问题 at February 03, 2013

    成了就好,rails_admin 具体的代码我没仔细看

  • 重写 Gem 的某些 helper 方法问题 at February 03, 2013

    我试了一下果然没有成功. 那就这样吧,在 config/initialize 新建一个 rb 文件,内容如下:

    RailsAdmin::ApplicationController.class_eval do def edit_user_link #coding end helper_method :edit_user_link end

    我用本地的一个 engine 测试过,成功覆盖了 engine 原有的 helper 方法。

  • 重写 Gem 的某些 helper 方法问题 at February 02, 2013

    好像改 engine 的 helper 方法有 bug,参考地址:https://github.com/rails/rails/issues/6496

    不过好像也有人解决了 http://stackoverflow.com/questions/9232175/access-main-app-helpers-when-overridings-a-rails-engine-view-layout

    大概流程就是把方法写在 main_app 的 helper 里面,然后将路径加到 engine 的 helper path 的数组上

    Engines are supposed to be independent from the main app, that is why you can't access its helpers from the Engine.

    However, there are hack-ish ways for giving your engine access to the helpers of the main app. This is how I did it:

    # In the main app # initializers/share_helpers_path_with_engine.rb PhotoGallery::Engine.class_eval do paths["app/helpers"] << File.join(File.dirname(FILE), '../..', 'app/helpers') end

    You need of course to change PhotoGallery to the actual name of your engine class.

    Feel free to take a look at the Engines documentation (section about the paths):
    http://edgeapi.rubyonrails.org/classes/Rails/Engine.html

    以上是别人答案。 你把 helper 方法写在项目的 application_helper.rb 里面,参照上面写个文件将 PhotoGallery::Engine 改为 RailsAdmin::Engine 应该就好了

  • 重写 Gem 的某些 helper 方法问题 at January 31, 2013

    在 config/initialize 里面加个文件 内容为

    require 'rails_admin/i18n_support' module RailsAdmin module ApplicationHelper include RailsAdmin::I18nSupport def edit_user_link #coding end end end

  • Web 开发敏捷之道中,Ajax 初体验这章里面,Ajax 不起作用 at January 26, 2013

    rjs 的语法个人感觉太奇葩,和一般的 js 语法差距太大,所以现在不支持 rjs 是正确的,感觉更自然!

  • rails 开发的简化方案 at January 25, 2013

    try sinatra

  • 我要买一个苹果本,请大家给看看,ROR 开发够用不? at January 24, 2013

    我建议你打消这个念头 跑 mac os 都难

  • 不知道用什么编辑器啊! at January 23, 2013

    sublime2 好用

  • 南京寻一 Rails 职位 at January 20, 2013

    oh 明星程序员!

  • 如何使用 define_method 定义 class method? at January 20, 2013

    engine_class = class << self; self; end engine_class.send(:define_method, callback) { |*args| code }

    又是一个茴字有几种写法的问题,不过这就是 ruby 神奇的地方!

  • Node.js 和 MongoDB 搭建的个人轻博客 at January 20, 2013

    这 UI 太 cool 了

  • 希望能找精通 Rails 的开发网站 at January 07, 2013

    rails/bootstrap/Jquery/postgresql 居然和我们用的一样不差 不过我没什么时间 你介意 github 协同嘛?

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