vendredi 20 mai 2016

Rails 3 best_in_place_if how to add "id" attribute to element

I am using best_in_place_if for inline editing. Here I want to catch the id of current element edited by using the ajax success event of best_in_place.

Below is code snippet I am trying to add id attribute. But when I inspect the html, the value for id attribute is the default value generated by the bes_in_place. As per their doc, its mentioned that the default value can be changed by providing our own value.

The default value for id attribute is shown as id="best_in_place_trip_32_is_active" and I want is only id=32

best_in_place_if(current_user.admin,trip,:is_active, :type => :checkbox, :classes => 'trip_disable', :id => trip.id)

Please let me know what I am missing.

Aucun commentaire:

Enregistrer un commentaire