module Lipsiadmin module View module Helpers module BackendHelper # This method work like builtin Rails error_message_for but use an Ext.Message. def simple_error_messages_for(*params) options = params.last.is_a?(Hash) ? params.pop.symbolize_keys : {} objects = params.collect {|object_name| instance_variable_get("@#{object_name}") }.compact count = objects.inject(0) {|sum, object| sum + object.errors.count } unless count.zero? error_messages = objects.map {|object| object.errors.full_messages.map {|msg| "