Sha256: a6098fe775f22ee8d8009bd37cbe1ef95ca5b4f2be7b2425cc85e5b54dcbfaf6

Contents?: true

Size: 445 Bytes

Versions: 2

Compression:

Stored size: 445 Bytes

Contents

class Admin::BaseController < ApplicationController
  protect_from_forgery
  layout 'admin'

  before_filter :show_errors

  private

  def show_errors
    ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
      if html_tag =~ /<label/
        %|<div class="fieldWithErrors">#{html_tag} <span class="error">#{[instance.error_message].join(', ')}</span></div>|.html_safe
      else
        html_tag
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
admin-theme-1.1.0 lib/generators/admin_theme/setup/controllers/admin_base_controller.rb
admin-theme-1.0.1 lib/generators/admin_theme/setup/controllers/admin_base_controller.rb