【问题标题】:how to update best_in_place version from github如何从 github 更新 best_in_place 版本
【发布时间】:2026-01-07 07:35:01
【问题描述】:

gryzzly 被告知从 github 更新我的 best_in_place 版本,以解决此问题:Checkboxes with images

他告诉从 github 更新,因为目前还没有包含此修复的版本。

所以,我写在我的Gemfile

gem 'best_in_place', :git => 'git://github.com/bernat/best_in_place.git'

然后运行:bundle install

这不能解决我的问题:show-images-in-checkbox-collection,所以我认为我做错了什么。

请帮忙。

【问题讨论】:

    标签: ruby-on-rails best-in-place


    【解决方案1】:

    尝试添加你认为合适的分支。在你的情况下:

    gem 'best_in_place', :git => 'git://github.com/bernat/best_in_place.git', :branch => 'fix-display-methods'
    

    编辑:研究提交,Gemfile 中的正确条目似乎是:

    gem "best_in_place",:git => 'git://github.com/bernat/best_in_place.git', :tag => "0665b5f2e41967d8d1616f953fa3c0983cef1d51"
    

    希望这能解决你的问题。

    编辑 2:今天我在我的机器上复制了你的代码,它运行良好。该标记似乎是正确的,您的代码中只有一件小事似乎令人困惑:在 Rails > 3 中,对图像的引用只是 image_tag("your_img.png")。你的代码应该是:

    <%= best_in_place task, :done,:classes => 'highlight_on_success', type: :checkbox, collection: [image_tag("checkbox_no.png"), image_tag("checkbox_yes.png")] %>
    

    祝你好运。

    【讨论】:

    • 我正在尝试。如果可以,请告诉我如何找到这个标签。我想知道下次如何解决同样的问题:] 谢谢..
    • 您应该找到 gem 的 github 位置,在您的情况下为 https://github.com/bernat/best_in_place 并寻找 commits 选项卡。有一个带有有意义的提交标签的年表。在提交的右侧,有一个可点击的区域,您点击那里并浏览提交代码。有很长的数字和字母组合,您在 Gemfile 中将其用作 :tag 。现在我相信你会找到正确的提交并且一切都会好起来的。
    • 好的,谢谢。。我会努力的,希望能找到。谢谢你! (我会更新这个话题)。
    最近更新 更多