From 0e2a5fd20503c433f4e582ed752b4515f0778b4b Mon Sep 17 00:00:00 2001 From: gabrielsandoval Date: Sun, 21 Jun 2015 15:24:07 +0800 Subject: [PATCH] Added search form on the places index page. --- Gemfile.lock | 3 +++ app/views/places/_search_form.html.haml | 6 ++++++ app/views/places/index.html.haml | 2 +- app/views/places/show.html.haml | 7 +------ config/database.yml | 1 + 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 app/views/places/_search_form.html.haml diff --git a/Gemfile.lock b/Gemfile.lock index fef7b8258..7e3b4aa92 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -458,3 +458,6 @@ DEPENDENCIES unicorn webrat will_paginate (~> 3.0) + +BUNDLED WITH + 1.10.3 diff --git a/app/views/places/_search_form.html.haml b/app/views/places/_search_form.html.haml new file mode 100644 index 000000000..e9f801c17 --- /dev/null +++ b/app/views/places/_search_form.html.haml @@ -0,0 +1,6 @@ +%form{:action => search_places_path, :method => :get, :class => 'form-inline', :role => 'form'} + .form-group + = label_tag :new_place, "Change location:", :class => 'sr-only' + = text_field_tag :new_place, '', :class => 'form-control', :placeholder => "New location..." + = submit_tag "Search", :class => 'btn btn-primary' +%br/ diff --git a/app/views/places/index.html.haml b/app/views/places/index.html.haml index 135d3a113..a81dd6ba8 100644 --- a/app/views/places/index.html.haml +++ b/app/views/places/index.html.haml @@ -1,4 +1,4 @@ -content_for :title, "#{ENV['GROWSTUFF_SITE_NAME']} Community Map" - += render partial: 'search_form' %div#placesmap diff --git a/app/views/places/show.html.haml b/app/views/places/show.html.haml index b34846b39..8cc9f86ef 100644 --- a/app/views/places/show.html.haml +++ b/app/views/places/show.html.haml @@ -1,11 +1,6 @@ -content_for :title, "#{ENV['GROWSTUFF_SITE_NAME']} members near #{@place}" -%form{:action => search_places_path, :method => :get, :class => 'form-inline', :role => 'form'} - .form-group - = label_tag :new_place, "Change location:", :class => 'sr-only' - = text_field_tag :new_place, '', :class => 'form-control', :placeholder => "New location..." - = submit_tag "Search", :class => 'btn btn-primary' -%br/ += render partial: 'search_form' %div#placesmap{ :style => "height:300px"} diff --git a/config/database.yml b/config/database.yml index 6b0ab1503..6aeb5d961 100644 --- a/config/database.yml +++ b/config/database.yml @@ -3,6 +3,7 @@ development: database: growstuff_dev host: localhost user: postgres + password: password test: adapter: postgresql