Commit 8a6a4e0b

mo khan <mo@mokhan.ca>
2013-12-29 23:13:16
remove city from registration.
1 parent 6422cdd
Changed files (3)
app
views
devise
registrations
sessions
spec
app/views/devise/registrations/new.html.erb
@@ -9,36 +9,6 @@
         $('#submit-registration').attr('disabled', 'disabled');
       }
     });
-    $('#user_city').autocomplete({
-      source: function(request, response){
-        $.ajax({
-          url: 'https://ws.geonames.org/searchJSON',
-          dataType: "jsonp",
-          data: {
-            featureClass: "P",
-            style: 'full',
-            maxRows: 12,
-            name_startsWith: request.term
-          },
-          success: function(data){
-            response( $.map(data.geonames, function(item){
-              return {
-                label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
-                value: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
-                latitude: item.lat,
-                longitude: item.lng
-              }
-            }));
-          }
-        });
-      },
-      minlength:2,
-      select:function(event, ui){
-        var item = ui.item;
-        $('#user_latitude').val(item.latitude);
-        $('#user_longitude').val(item.longitude);
-      }
-    });
     mixpanel.track_forms(".form-inline", "signed in");
     mixpanel.track_forms(".form-horizontal", "registered");
   });
@@ -75,12 +45,6 @@
                   <%= f.text_field :name, :placeholder => 'required' %>
                 </div>
               </div>
-              <div class="control-group">
-                <%= f.label :city, 'City', :class => "control-label" %>
-                <div class="controls">
-                  <%= f.text_field :city, :placeholder => 'optional' %>
-                </div>
-              </div>
               <div class="control-group">
                 <%= f.label :email, 'Email', :class => "control-label" %>
                 <div class="controls">
app/views/devise/sessions/new.html.erb
@@ -9,36 +9,6 @@
         $('#submit-registration').attr('disabled', 'disabled');
       }
     });
-    $('#user_city').autocomplete({
-      source: function(request, response){
-        $.ajax({
-          url: 'https://ws.geonames.org/searchJSON',
-          dataType: "jsonp",
-          data: {
-            featureClass: "P",
-            style: 'full',
-            maxRows: 12,
-            name_startsWith: request.term
-          },
-          success: function(data){
-            response( $.map(data.geonames, function(item){
-              return {
-                label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
-                value: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
-                latitude: item.lat,
-                longitude: item.lng
-              }
-            }));
-          }
-        });
-      },
-      minlength:2,
-      select:function(event, ui){
-        var item = ui.item;
-        $('#user_latitude').val(item.latitude);
-        $('#user_longitude').val(item.longitude);
-      }
-    });
   });
 </script>
 <% end %>
@@ -73,12 +43,6 @@
               <%= f.text_field :name, :placeholder => 'required' %>
             </div>
           </div>
-          <div class="control-group">
-            <%= f.label :city, 'City', :class => "control-label" %>
-            <div class="controls">
-              <%= f.text_field :city, :placeholder => 'optional' %>
-            </div>
-          </div>
           <div class="control-group">
             <%= f.label :email, 'Email', :class => "control-label" %>
             <div class="controls">
spec/features/registration_spec.rb
@@ -6,7 +6,6 @@ describe "Registration", :js => true do
       visit "/login"
       within(".form-horizontal") do
         fill_in('user_name', :with => 'John Smith')
-        fill_in('user_city', :with => 'Calgary, Alberta, Canada')
         fill_in('user_email',:with => Faker::Internet.email)
         fill_in('user_password', :with => 'password')
         fill_in('user_password_confirmation', :with => 'password')