Sha256: b74d38a3c6325d9911931df93c3fc36bf646252e587250e077d9b68b3e5e865e

Contents?: true

Size: 577 Bytes

Versions: 79

Compression:

Stored size: 577 Bytes

Contents

module Tenon
  class CommentDecorator < ApplicationDecorator
    def email
      @object.author_email
    end

    def author_url
      url = @object.author_url
      if url.blank? || url.match('http://') || url.match('https://')
        url
      else
        'http://' + url
      end
    end

    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
  end
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
tenon-1.1.4 app/decorators/tenon/comment_decorator.rb
tenon-1.1.3 app/decorators/tenon/comment_decorator.rb
tenon-1.1.2 app/decorators/tenon/comment_decorator.rb
tenon-1.1.1 app/decorators/tenon/comment_decorator.rb
tenon-1.0.76 app/decorators/tenon/comment_decorator.rb
tenon-1.0.75 app/decorators/tenon/comment_decorator.rb
tenon-1.0.74 app/decorators/tenon/comment_decorator.rb
tenon-1.0.73 app/decorators/tenon/comment_decorator.rb
tenon-1.0.72 app/decorators/tenon/comment_decorator.rb
tenon-1.0.71 app/decorators/tenon/comment_decorator.rb
tenon-1.0.70 app/decorators/tenon/comment_decorator.rb
tenon-1.0.69 app/decorators/tenon/comment_decorator.rb
tenon-1.0.68 app/decorators/tenon/comment_decorator.rb
tenon-1.0.67 app/decorators/tenon/comment_decorator.rb
tenon-1.0.66 app/decorators/tenon/comment_decorator.rb
tenon-1.0.65 app/decorators/tenon/comment_decorator.rb
tenon-1.0.64 app/decorators/tenon/comment_decorator.rb
tenon-1.0.63 app/decorators/tenon/comment_decorator.rb
tenon-1.0.62 app/decorators/tenon/comment_decorator.rb
tenon-1.0.61 app/decorators/tenon/comment_decorator.rb