Created
January 26, 2011 23:01
-
-
Save jxpx777/797700 to your computer and use it in GitHub Desktop.
User model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ActionView::Template::Error) "invalid byte sequence in UTF-8" | |
------------------------------- | |
Backtrace: | |
------------------------------- | |
activesupport (3.0.3) lib/active_support/core_ext/object/blank.rb:68:in `=~' | |
activesupport (3.0.3) lib/active_support/core_ext/object/blank.rb:68:in `!~' | |
activesupport (3.0.3) lib/active_support/core_ext/object/blank.rb:68:in `blank?' | |
app/models/user.rb:57:in `city_and_state' | |
activerecord (3.0.3) lib/active_record/associations/association_proxy.rb:218:in `method_missing' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def city_and_state | |
result = [] | |
result << city.to_s unless city.blank? | |
result << self.displayable_state unless self.displayable_state == "" | |
return result * ", " | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment