This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
binaryattraction/app/helpers/global_helpers.rb

16 lines
303 B
Ruby

module Merb
module GlobalHelpers
def logged_in?
!session[:user_id].nil?
end
def error_messages(obj)
if obj.errors.empty?
nil
else
"<div id='model_errors'><ul>#{obj.errors.each_full { |msg| "<li>#{msg}</li>" }}</ul></div>"
end
end
end
end