ref: master
app/views/shared/_location_form.html.erb
<% field = optional_field(profile, 'location') do %><%= f.hidden_field :lat, :id => 'profile_data_lat' %> <%= f.hidden_field :lng, :id => 'profile_data_lng' %> <%= content_tag('script', '', :src => "https://maps.googleapis.com/maps/api/js?key=#{GoogleMaps.api_key}", :type => 'text/javascript') %> <%= content_tag('script', render(:partial => 'maps/google_map.js', :locals => { profile: profile }), :type => 'text/javascript') %> <% end %> <% unless field.blank? %> <% if profile.active_fields.include?('location') %><% end %><%= f.text_field(:city, :id => 'profile_data_city', :rel => _('City')) %> <%= f.text_field(:state, :id => 'profile_data_state', :rel => _('State')) %><%= select_country(_('Country'), f.object_name, 'country', {:class => 'type-select', :id => 'profile_data_country'}, :selected => profile.country) %> <%= f.text_field(:zip_code, :id => 'profile_data_zip_code', :rel => _('ZIP code')) %><%= f.text_field(:district, :id => 'profile_data_district', :rel => _('District')) %> <%= f.text_field(:address, :id => 'profile_data_address', :rel => _('Address')) %> <%= f.text_field(:address_line, :id => 'profile_data_address_line2', :rel => _('Address')) %><%= field %><% end %>