Method: PageRecord::Helpers#error_for

Defined in:
lib/page_record/helpers.rb

#error_for(name) ⇒ Object

Returns a hash containing the error name. This can be used as html options in rails helpers

example:

TODO: Make an example

this returns the follwing HTML:

<div data-error-for="name">can't be blank</div>

Parameters:

  • name

    Symbol or String identifying the name

Returns:

  • Hash



140
141
142
# File 'lib/page_record/helpers.rb', line 140

def error_for(name)
  Hash['data-error-for', name]
end