Sha256: ed760fe56f2668203ad4fd7a7156d867ecae470baaf98b08b5d5891cfed37f40
Contents?: true
Size: 1008 Bytes
Versions: 14
Compression:
Stored size: 1008 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
14 entries across 14 versions & 1 rubygems