Attributes
-
update: one or more DOM ID’s (comma separated string or an array) to be updated as part of the ajax call.
NOTE: yes that’s DOM ID’s not part-names. A common source of confusion because by default the part name and DOM ID are the same.
-
message: A message to display in the ajax-progress spinner. Default: “Saving…”
Show Source
<def attrs='update, message' tag='boolean-checkbox-editor'><%
raise HoboError.new("Not allowed to edit") unless can_edit?
f = ajax_updater(object_url(this_parent, :method => :put),
update,
:method => "put",
:message => message,
:spinner_next_to => Hobo.raw_js("this"),
:params => { this_parent.class.name.underscore => {
this_field => Hobo.raw_js('this.checked')
} })
%>
<input type='checkbox' value='1' merge-attrs='& this ? attributes.merge(:checked => 'checked') : attributes' onclick='#{f}'/>
</def>