1

I use best_in_place (it's not important for my question).

I want to show images instead of the checkbox.

my images are found in: public/images.

so I tried:

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

unfortunately, the default image of the checkbox (should be the first image) is shown as -, and when I press it, I saw the second image.

I tried to check if there is a problem with my first image, so I changed my code into:

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

But the default image (should be the second image) was shown as -, and when I pressed it, I saw the first image.

please help.

Maor Cohen
  • 936
  • 2
  • 18
  • 33

1 Answers1

0

This issue is addressed in a recent pull request, so update your best_in_place version to get this issue resolved. As can be seen from the test code your syntax should be fine.

praseodym
  • 2,134
  • 15
  • 29
  • wow, I don't believe that I spent about 6 hours in order to solve it! how can I update my best_in_place? by 'bundle update'? – Maor Cohen Jan 10 '13 at 20:52
  • There is no release with this fix yet (2.0.2 is from 28 Nov), so use the version from Github: http://stackoverflow.com/questions/2577346/how-to-install-gem-from-github-source – praseodym Jan 10 '13 at 20:56