Module: TwiceBaked::ApplicationHelper
- Defined in:
- app/helpers/twice_baked/application_helper.rb
Instance Method Summary collapse
Instance Method Details
#tb_form_errors(record) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'app/helpers/twice_baked/application_helper.rb', line 3 def tb_form_errors(record) if record.errors.any? content_tag :div, :class => 'form-errors' do concat(content_tag :h4, "Please correct the following #{pluralize(record.errors.size, 'error')}:") concat(raw "<ul>") concat(raw record.errors..collect{ |msg| "<li>#{msg}</li>" }.join()) concat(raw "</ul>") end end end |