Showing Full Country Name in Global Autocomplete
How can I fetch a full country name in the search.json.jbuilder. I am using the Country_select gem and autocomplete results is showing only a country short code like GB for United Kingdom.
Here is my code in the search.json.jbuilder:
json.movies do
json.array!(@movies) do |movie|
json.name movie.title.titleize + " " + "in" + " " + movie.country
json.url movie_path(movie)
end
movie.rb
def country_name
country = self.country
ISO3166::Country[country]
end
Thanks
Here is my code in the search.json.jbuilder:
json.movies do
json.array!(@movies) do |movie|
json.name movie.title.titleize + " " + "in" + " " + movie.country
json.url movie_path(movie)
end
movie.rb
def country_name
country = self.country
ISO3166::Country[country]
end
Thanks