diff --git a/app/views/events/_form.html.haml b/app/views/events/_form.html.haml index 065ad846..698bf265 100644 --- a/app/views/events/_form.html.haml +++ b/app/views/events/_form.html.haml @@ -39,8 +39,8 @@ = f.label Event.human_attribute_name :city = f.text_field :city, required: true, size: 70, list: :cities %datalist#cities - - City.all.each do |city| - %option= city.name + - City.connection.select_values('select distinct name from cities join events on name=city').each do |name| + %option= name .field = f.label Event.human_attribute_name :related_region = f.select :region,