Sha256: c7f49a77aa823b3db9a9c5ac662c9267d7e52f21491ee2fce2f6d4cdb1cd9a41
Contents?: true
Size: 754 Bytes
Versions: 18
Compression:
Stored size: 754 Bytes
Contents
module LiveRecord module ActionViewExtensions module ViewHelper def live_record_element(record) raw " data-live-record-element='#{record.class.name}-#{record.id}' " end def live_record_updatable(record, attribute) raise ArgumentError, "[#{record.class}] does not have an attribute named [#{attribute}]" unless record.attribute_names.include? attribute.to_s raw " data-live-record-update-from='#{record.class.name}-#{record.id}-#{attribute}' " end def live_record_destroyable(record) raw " data-live-record-destroy-from='#{record.class.name}-#{record.id}' " end end end end ActiveSupport.on_load(:action_view) do include LiveRecord::ActionViewExtensions::ViewHelper end
Version data entries
18 entries across 18 versions & 1 rubygems