comparison app/helpers/application_helper.rb @ 437:d31fe32da7a0

Finish updating to rails 5
author nanaya <me@myconan.net>
date Sat, 02 Jul 2016 17:04:25 +0900
parents 851432f21603
children 68231013b01b
comparison
equal deleted inserted replaced
436:72557a5310d9 437:d31fe32da7a0
9 end 9 end
10 10
11 def error_class(object, attribute) 11 def error_class(object, attribute)
12 "has-error" if object.errors.include? attribute 12 "has-error" if object.errors.include? attribute
13 end 13 end
14
15 def with_host(url)
16 return url if url[0] != "/"
17
18 "#{request.protocol}#{request.host_with_port}#{url}"
19 end
14 end 20 end