Sha256: 04e47d0f102b6d7294a69a69a22d1df3897920d6b065717199deb0a768fa5284
Contents?: true
Size: 969 Bytes
Versions: 25
Compression:
Stored size: 969 Bytes
Contents
module Roroacms module CommentsHelper # returns the html for the error display for the comments form # Params: # +content+:: is the Comment ActiveRecord object with the errors def comments_error_display(content = nil) html = '' if content.errors.any? html = "<div id='error-explanation'> <h2>Invalid:</h2><ul>" content.errors.full_messages.each do |msg| html += "<li>#{msg}</li>" end html += "</ul> </div>" end html end # returns a success message if the comment has been saved successfully def comments_success_message html = '<div class="success">' + I18n.t("helpers.comments_helper.comments_success_message") + '</div>'.html_safe end # returns true or false as to wether the admin has comments turned on def comments_on Setting.get('article_comments') == 'Y' && Setting.get('article_comment_type') == 'R' end end end
Version data entries
25 entries across 25 versions & 1 rubygems