Class: Tenon::CommentDecorator
Instance Method Summary
collapse
#delete_link, #edit_link, #edit_path, #path, #published?
Instance Method Details
#author_url ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'app/decorators/tenon/comment_decorator.rb', line 7
def author_url
url = @object.author_url
if url.blank? || url.match('http://') || url.match('https://')
url
else
'http://' + url
end
end
|
#email ⇒ Object
3
4
5
|
# File 'app/decorators/tenon/comment_decorator.rb', line 3
def email
@object.author_email
end
|
#error_message ⇒ Object
16
17
18
19
20
|
# File 'app/decorators/tenon/comment_decorator.rb', line 16
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
|