module LiveRecord::ActionViewExtensions::ViewHelper
Public Instance Methods
live_record_destroyable(record)
click to toggle source
# File lib/live_record/action_view_extensions/view_helper.rb, line 13 def live_record_destroyable(record) raw " data-live-record-destroy-from='#{record.class.name}-#{record.id}' " end
live_record_element(record)
click to toggle source
# File lib/live_record/action_view_extensions/view_helper.rb, line 4 def live_record_element(record) raw " data-live-record-element='#{record.class.name}-#{record.id}' " end
live_record_updatable(record, attribute)
click to toggle source
# File lib/live_record/action_view_extensions/view_helper.rb, line 8 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