Module: AsyncDataFetch::ViewHelpers

Defined in:
lib/async_data_fetch/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#fetch_async(model_name:, model_id:, model_method:, tag: "span", placeholder: "?", display_error: false, extra_classes: "") ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/async_data_fetch/view_helpers.rb', line 3

def fetch_async(model_name: , model_id: , model_method: , tag: "span", placeholder: "?", display_error: false, extra_classes: "")

	if !!display_error != display_error then
		raise "display_error has to be a boolean."
	end

	render partial: 'async_data_fetch/fetch_async_data', locals: {_tag: tag, _model_name: model_name.to_s, _model_id: model_id.to_s, _model_method: model_method.to_s, _placeholder: placeholder.to_s, _class: 'fetch_data_async ' + extra_classes.to_s, _display_error: display_error }
end