I have a partial set up as follows:
<%= best_in_place_if can?(:edit, Artist), @artist, :display_name, type: :input, :activator => "#activator" %>
<a href="#" id="activator">Edit</a>
When I click the Edit
link, nothing happens.
If I remove :activator => "#activator"
from the best_in_place link, it then allows me to click the text field to start editing as I expect; the only problem is this doesn't work on iPad so I need a separate button to trigger this edit function.
Does anyone know of a workaround for getting the :activator
setting working, or have another suggestion (including a different gem) that they know would work for in place editing of fields?
Are you using the partial to display a list of artists? Perhaps the ID isn't specific enough, so it's getting confused since there's an activator link with id "activator", but there are multiple "activator"s at the same time. Try being more specific with the ID. Something like:
<%= best_in_place_if can?(:edit, Artist), @artist, :display_name, type: :input, :activator => "#activator-#{@artist.id}" %>
<a href="#" id="activator-#{@artist.id}">Edit</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With