
[英]How to update specific attributes from restricted model using Best_In_Place and Cancan
[英]how to update best_in_place version from github
gryzzly
被告知我更新从GitHub我best_in_place版本,为了解决这个问题: 复选框与图片
他告诉要从github更新,因为此修复程序尚未发布。
因此,我在Gemfile
写道:
gem 'best_in_place', :git => 'git://github.com/bernat/best_in_place.git'
然后运行: bundle install
。
这不能解决我的问题: show-images-in-checkbox-collection ,所以我认为我做错了。
请帮忙。
尝试添加您认为适当的分支。 在您的情况下:
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")] %>
祝好运 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.