Class: Tenon::ContactDecorator

Inherits:
ApplicationDecorator show all
Defined in:
app/decorators/tenon/contact_decorator.rb

Instance Method Summary collapse

Methods inherited from ApplicationDecorator

#delete_link, #edit_link, #edit_path, #path, #published?

Instance Method Details

#error_messageObject



7
8
9
10
11
# File 'app/decorators/tenon/contact_decorator.rb', line 7

def error_message
  errors = []
  @object.errors.full_messages.each { |error| errors << "<li>#{error}</li>" }
  "<div class='error-explanation' id='error-explanation'>There were problems with the following fields:<ul>#{errors.join('')}<ul></div>"
end

#sent_dateObject



3
4
5
# File 'app/decorators/tenon/contact_decorator.rb', line 3

def sent_date
  @object.created_at.strftime('%B %e, %Y at %l:%M %p')
end