Created
May 10, 2010 18:58
-
-
Save emarashliev/396377 to your computer and use it in GitHub Desktop.
This file contains 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
class Offer < ActiveRecord::Base | |
belongs_to :offer_type | |
belongs_to :offer_rate | |
belongs_to :city | |
belongs_to :location | |
... | |
end | |
module ApplicationHelper | |
def get_city_name(id) | |
city = City.find(id) | |
city_name = city.name | |
Unicode::downcase(city_name) | |
Unicode::capitalize(city_name) | |
rescue | |
city_name = "" | |
end | |
#Get Location Name | |
def get_location_name(id) | |
location = Location.find(id).name | |
Unicode::downcase(location) | |
Unicode::capitalize(location) | |
rescue | |
location = "" | |
end | |
#Get OfferType Name | |
def get_offer_type(id) | |
offer_type = OfferType.find(id).name | |
rescue | |
offer_type = "" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment