Upgrade to Rails 3.1.0.beta1
|
@ -3,4 +3,4 @@ db/*.sqlite3
|
|||
log/*.log
|
||||
tmp/
|
||||
.DS_Store
|
||||
.rvmrc
|
||||
.rvmrc
|
||||
|
|
10
Gemfile
|
@ -1,13 +1,21 @@
|
|||
source 'http://rubygems.org'
|
||||
|
||||
gem 'rails'
|
||||
gem 'rails', '3.1.0.beta1'
|
||||
gem 'geokit'
|
||||
gem 'devise'
|
||||
|
||||
# Asset template engines
|
||||
gem 'sass'
|
||||
gem 'coffee-script'
|
||||
gem 'uglifier'
|
||||
|
||||
gem 'jquery-rails'
|
||||
|
||||
group :development do
|
||||
gem 'pg'
|
||||
end
|
||||
|
||||
group :test do
|
||||
gem 'turn', :require => false
|
||||
gem 'sqlite3'
|
||||
end
|
||||
|
|
133
Gemfile.lock
|
@ -1,77 +1,107 @@
|
|||
GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
abstract (1.0.0)
|
||||
actionmailer (3.0.7)
|
||||
actionpack (= 3.0.7)
|
||||
mail (~> 2.2.15)
|
||||
actionpack (3.0.7)
|
||||
activemodel (= 3.0.7)
|
||||
activesupport (= 3.0.7)
|
||||
builder (~> 2.1.2)
|
||||
erubis (~> 2.6.6)
|
||||
i18n (~> 0.5.0)
|
||||
rack (~> 1.2.1)
|
||||
rack-mount (~> 0.6.14)
|
||||
rack-test (~> 0.5.7)
|
||||
tzinfo (~> 0.3.23)
|
||||
activemodel (3.0.7)
|
||||
activesupport (= 3.0.7)
|
||||
builder (~> 2.1.2)
|
||||
i18n (~> 0.5.0)
|
||||
activerecord (3.0.7)
|
||||
activemodel (= 3.0.7)
|
||||
activesupport (= 3.0.7)
|
||||
arel (~> 2.0.2)
|
||||
tzinfo (~> 0.3.23)
|
||||
activeresource (3.0.7)
|
||||
activemodel (= 3.0.7)
|
||||
activesupport (= 3.0.7)
|
||||
activesupport (3.0.7)
|
||||
arel (2.0.9)
|
||||
actionmailer (3.1.0.beta1)
|
||||
actionpack (= 3.1.0.beta1)
|
||||
mail (~> 2.3.0)
|
||||
actionpack (3.1.0.beta1)
|
||||
activemodel (= 3.1.0.beta1)
|
||||
activesupport (= 3.1.0.beta1)
|
||||
builder (~> 3.0.0)
|
||||
erubis (~> 2.7.0)
|
||||
i18n (~> 0.6.0beta1)
|
||||
rack (~> 1.3.0.beta)
|
||||
rack-cache (~> 1.0.1)
|
||||
rack-mount (~> 0.7.2)
|
||||
rack-test (~> 0.6.0)
|
||||
sprockets (~> 2.0.0.beta.2)
|
||||
tzinfo (~> 0.3.27)
|
||||
activemodel (3.1.0.beta1)
|
||||
activesupport (= 3.1.0.beta1)
|
||||
bcrypt-ruby (~> 2.1.4)
|
||||
builder (~> 3.0.0)
|
||||
i18n (~> 0.6.0beta1)
|
||||
activerecord (3.1.0.beta1)
|
||||
activemodel (= 3.1.0.beta1)
|
||||
activesupport (= 3.1.0.beta1)
|
||||
arel (~> 2.1.0)
|
||||
tzinfo (~> 0.3.27)
|
||||
activeresource (3.1.0.beta1)
|
||||
activemodel (= 3.1.0.beta1)
|
||||
activesupport (= 3.1.0.beta1)
|
||||
activesupport (3.1.0.beta1)
|
||||
multi_json (~> 1.0)
|
||||
ansi (1.2.5)
|
||||
arel (2.1.0)
|
||||
bcrypt-ruby (2.1.4)
|
||||
builder (2.1.2)
|
||||
builder (3.0.0)
|
||||
coffee-script (2.2.0)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.1.0)
|
||||
devise (1.3.4)
|
||||
bcrypt-ruby (~> 2.1.2)
|
||||
orm_adapter (~> 0.0.3)
|
||||
warden (~> 1.0.3)
|
||||
erubis (2.6.6)
|
||||
abstract (>= 1.0.0)
|
||||
erubis (2.7.0)
|
||||
execjs (0.3.2)
|
||||
multi_json (~> 1.0)
|
||||
geokit (1.5.0)
|
||||
i18n (0.5.0)
|
||||
mail (2.2.19)
|
||||
activesupport (>= 2.3.6)
|
||||
hike (1.0.0)
|
||||
i18n (0.6.0beta1)
|
||||
jquery-rails (1.0)
|
||||
rails (~> 3.0)
|
||||
thor (~> 0.14)
|
||||
json (1.5.1)
|
||||
mail (2.3.0)
|
||||
i18n (>= 0.4.0)
|
||||
mime-types (~> 1.16)
|
||||
treetop (~> 1.4.8)
|
||||
mime-types (1.16)
|
||||
multi_json (1.0.1)
|
||||
orm_adapter (0.0.4)
|
||||
pg (0.11.0)
|
||||
polyglot (0.3.1)
|
||||
rack (1.2.2)
|
||||
rack-mount (0.6.14)
|
||||
rack (1.3.0.beta)
|
||||
rack-cache (1.0.1)
|
||||
rack (>= 0.4)
|
||||
rack-mount (0.7.2)
|
||||
rack (>= 1.0.0)
|
||||
rack-test (0.5.7)
|
||||
rack-ssl (1.3.2)
|
||||
rack
|
||||
rack-test (0.6.0)
|
||||
rack (>= 1.0)
|
||||
rails (3.0.7)
|
||||
actionmailer (= 3.0.7)
|
||||
actionpack (= 3.0.7)
|
||||
activerecord (= 3.0.7)
|
||||
activeresource (= 3.0.7)
|
||||
activesupport (= 3.0.7)
|
||||
rails (3.1.0.beta1)
|
||||
actionmailer (= 3.1.0.beta1)
|
||||
actionpack (= 3.1.0.beta1)
|
||||
activerecord (= 3.1.0.beta1)
|
||||
activeresource (= 3.1.0.beta1)
|
||||
activesupport (= 3.1.0.beta1)
|
||||
bundler (~> 1.0)
|
||||
railties (= 3.0.7)
|
||||
railties (3.0.7)
|
||||
actionpack (= 3.0.7)
|
||||
activesupport (= 3.0.7)
|
||||
railties (= 3.1.0.beta1)
|
||||
railties (3.1.0.beta1)
|
||||
actionpack (= 3.1.0.beta1)
|
||||
activesupport (= 3.1.0.beta1)
|
||||
rack-ssl (~> 1.3.2)
|
||||
rake (>= 0.8.7)
|
||||
thor (~> 0.14.4)
|
||||
thor (~> 0.14.6)
|
||||
rake (0.8.7)
|
||||
sass (3.1.1)
|
||||
sprockets (2.0.0.beta.2)
|
||||
hike (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.0)
|
||||
sqlite3 (1.3.3)
|
||||
thor (0.14.6)
|
||||
tilt (1.3)
|
||||
treetop (1.4.9)
|
||||
polyglot (>= 0.3.1)
|
||||
turn (0.8.2)
|
||||
ansi (>= 1.2.2)
|
||||
tzinfo (0.3.27)
|
||||
uglifier (0.5.1)
|
||||
execjs
|
||||
json
|
||||
warden (1.0.4)
|
||||
rack (>= 1.0)
|
||||
|
||||
|
@ -79,8 +109,13 @@ PLATFORMS
|
|||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
coffee-script
|
||||
devise
|
||||
geokit
|
||||
jquery-rails
|
||||
pg
|
||||
rails
|
||||
rails (= 3.1.0.beta1)
|
||||
sass
|
||||
sqlite3
|
||||
turn
|
||||
uglifier
|
||||
|
|
2
Rakefile
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env rake
|
||||
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||||
|
||||
require File.expand_path('../config/application', __FILE__)
|
||||
require 'rake'
|
||||
|
||||
AdoptAHydrant::Application.load_tasks
|
||||
|
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
@ -20,7 +20,7 @@ $(function() {
|
|||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(13.0, 18.0)
|
||||
);
|
||||
var shadow = new google.maps.MarkerImage('/images/markers/shadow.png',
|
||||
var shadow = new google.maps.MarkerImage('/assets/markers/shadow.png',
|
||||
new google.maps.Size(46.0, 37.0),
|
||||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(13.0, 18.0)
|
||||
|
@ -84,7 +84,6 @@ $(function() {
|
|||
$('#address').removeClass('error', 500);
|
||||
var i = -1;
|
||||
$(data).each(function(index, hydrant) {
|
||||
hydrant = hydrant.hydrant;
|
||||
if($.inArray(hydrant.id, hydrantIds) == -1) {
|
||||
i += 1;
|
||||
} else {
|
||||
|
@ -93,7 +92,7 @@ $(function() {
|
|||
}
|
||||
setTimeout(function() {
|
||||
point = new google.maps.LatLng(hydrant.lat, hydrant.lng);
|
||||
color = '/images/markers/' + (hydrant.user_id ? 'green' : 'red') + '.png';
|
||||
color = '/assets/markers/' + (hydrant.user_id ? 'green' : 'red') + '.png';
|
||||
addMarker(hydrant.id, point, color);
|
||||
}, i * 100);
|
||||
});
|
||||
|
@ -424,7 +423,7 @@ $(function() {
|
|||
success: function(data) {
|
||||
activeInfoWindow.setContent(data);
|
||||
activeInfoWindow.setContent(data);
|
||||
image = new google.maps.MarkerImage('/images/markers/green.png',
|
||||
image = new google.maps.MarkerImage('/assets/markers/green.png',
|
||||
new google.maps.Size(27.0, 37.0),
|
||||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(13.0, 18.0)
|
||||
|
@ -475,7 +474,7 @@ $(function() {
|
|||
},
|
||||
success: function(data) {
|
||||
activeInfoWindow.setContent(data);
|
||||
image = new google.maps.MarkerImage('/images/markers/red.png',
|
||||
image = new google.maps.MarkerImage('/assets/markers/red.png',
|
||||
new google.maps.Size(27.0, 37.0),
|
||||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(13.0, 18.0)
|
||||
|
@ -527,7 +526,7 @@ $(function() {
|
|||
},
|
||||
success: function(data) {
|
||||
activeInfoWindow.setContent(data);
|
||||
image = new google.maps.MarkerImage('/images/markers/red.png',
|
||||
image = new google.maps.MarkerImage('/assets/markers/red.png',
|
||||
new google.maps.Size(27.0, 37.0),
|
||||
new google.maps.Point(0, 0),
|
||||
new google.maps.Point(13.0, 18.0)
|
|
@ -1,8 +1,10 @@
|
|||
class AddressesController < ApplicationController
|
||||
respond_to :json
|
||||
|
||||
def show
|
||||
@address = Address.find_lat_lng("#{params[:address]}, #{params[:city_state]}")
|
||||
unless @address.blank?
|
||||
render(:json => @address)
|
||||
respond_with @address
|
||||
else
|
||||
render(:json => {"errors" => {"address" => ["Could not find address."]}})
|
||||
end
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
class HydrantsController < ApplicationController
|
||||
respond_to :json, :only => [:list, :update]
|
||||
|
||||
def show
|
||||
@hydrant = Hydrant.find_by_id(params[:hydrant_id])
|
||||
if @hydrant.adopted?
|
||||
|
@ -19,7 +21,7 @@ class HydrantsController < ApplicationController
|
|||
def list
|
||||
@hydrants = Hydrant.find_closest(params[:lat], params[:lng])
|
||||
unless @hydrants.blank?
|
||||
render(:json => @hydrants)
|
||||
respond_with @hydrants
|
||||
else
|
||||
render(:json => {"errors" => {"address" => ["Could not find address."]}})
|
||||
end
|
||||
|
@ -28,7 +30,7 @@ class HydrantsController < ApplicationController
|
|||
def update
|
||||
@hydrant = Hydrant.find(params[:id])
|
||||
if @hydrant.update_attributes(params[:hydrant])
|
||||
render(:json => @hydrant)
|
||||
respond_with @hydrant
|
||||
else
|
||||
render(:json => {"errors" => @hydrant.errors})
|
||||
end
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
class UsersController < Devise::RegistrationsController
|
||||
respond_to :json, :only => [:create]
|
||||
|
||||
def edit
|
||||
render("edit", :layout => "info_window")
|
||||
end
|
||||
|
@ -21,7 +23,7 @@ class UsersController < Devise::RegistrationsController
|
|||
else
|
||||
expire_session_data_after_sign_in!
|
||||
end
|
||||
render(:json => resource)
|
||||
respond_with resource
|
||||
else
|
||||
clean_up_passwords(resource)
|
||||
render(:json => {"errors" => resource.errors})
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" %>
|
||||
<%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" %>
|
||||
<%= javascript_include_tag "https://github.com/scottschiller/Snowstorm/raw/master/snowstorm-min.js" %>
|
||||
<%= javascript_include_tag :all %>
|
||||
<%= javascript_include_tag "main" %>
|
||||
<%= csrf_meta_tag %>
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
</head>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div id="loader" style="display: none;">
|
||||
<img src="/images/ajax-loader.gif" />
|
||||
<%= image_tag "ajax-loader.gif" %>
|
||||
</div>
|
||||
<div id="info_window">
|
||||
<%= yield %>
|
||||
|
|
|
@ -30,13 +30,24 @@ module AdoptAHydrant
|
|||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||
# config.i18n.default_locale = :de
|
||||
|
||||
# Please note that JavaScript expansions are *ignored altogether* if the asset
|
||||
# pipeline is enabled (see config.assets.enabled below). Put your defaults in
|
||||
# app/assets/javascripts/application.js in that case.
|
||||
#
|
||||
# JavaScript files you want as :defaults (application.js is always included).
|
||||
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
||||
# config.action_view.javascript_expansions[:defaults] = %w(prototype prototype_ujs)
|
||||
|
||||
|
||||
# Configure the default encoding used in templates for Ruby 1.9.
|
||||
config.encoding = "utf-8"
|
||||
|
||||
# Configure sensitive parameters which will be filtered from the log file.
|
||||
config.filter_parameters += [:password]
|
||||
|
||||
# Enable IdentityMap for Active Record, to disable set to false or remove the line below.
|
||||
config.active_record.identity_map = true
|
||||
|
||||
# Enable the asset pipeline
|
||||
config.assets.enabled = true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ AdoptAHydrant::Application.configure do
|
|||
|
||||
# In the development environment your application's code is reloaded on
|
||||
# every request. This slows down response time but is perfect for development
|
||||
# since you don't have to restart the webserver when you make code changes.
|
||||
# since you don't have to restart the web server when you make code changes.
|
||||
config.cache_classes = false
|
||||
|
||||
# Log error messages when you accidentally call methods on nil.
|
||||
|
@ -11,18 +11,15 @@ AdoptAHydrant::Application.configure do
|
|||
|
||||
# Show full error reports and disable caching
|
||||
config.consider_all_requests_local = true
|
||||
config.action_view.debug_rjs = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
# Don't care if the mailer can't send
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
config.action_mailer.default_url_options = {:host => 'localhost:3000'}
|
||||
|
||||
# Print deprecation notices to the Rails logger
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
# Only use best-standards-support built into browsers
|
||||
config.action_dispatch.best_standards_support = :builtin
|
||||
|
||||
config.action_mailer.default_url_options = {:host => 'localhost:3000'}
|
||||
end
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
AdoptAHydrant::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
# The production environment is meant for finished, "live" apps.
|
||||
# Code is not reloaded between requests
|
||||
config.cache_classes = true
|
||||
|
||||
|
@ -9,14 +8,19 @@ AdoptAHydrant::Application.configure do
|
|||
config.consider_all_requests_local = false
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
# Disable Rails's static asset server (Apache or nginx will already do this)
|
||||
config.serve_static_assets = false
|
||||
|
||||
# Compress both stylesheets and JavaScripts
|
||||
config.assets.js_compressor = :uglifier
|
||||
config.assets.css_compressor = :scss
|
||||
|
||||
# Specifies the header that your server uses for sending files
|
||||
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
||||
# (comment out if your front-end server doesn't support this)
|
||||
config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx
|
||||
|
||||
# For nginx:
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
||||
|
||||
# If you have no front-end server that supports something like X-Sendfile,
|
||||
# just comment this out and Rails will serve the files
|
||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||
# config.force_ssl = true
|
||||
|
||||
# See everything in the log (default is :info)
|
||||
# config.log_level = :debug
|
||||
|
@ -27,15 +31,15 @@ AdoptAHydrant::Application.configure do
|
|||
# Use a different cache store in production
|
||||
# config.cache_store = :mem_cache_store
|
||||
|
||||
# Disable Rails's static asset server
|
||||
# In production, Apache or nginx will already do this
|
||||
config.serve_static_assets = false
|
||||
|
||||
# Enable serving of images, stylesheets, and javascripts from an asset server
|
||||
# config.action_controller.asset_host = "http://assets.example.com"
|
||||
|
||||
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
||||
# config.assets.precompile += %w( search.js )
|
||||
|
||||
# Disable delivery errors, bad email addresses will be ignored
|
||||
# config.action_mailer.raise_delivery_errors = false
|
||||
config.action_mailer.default_url_options = {:host => 'adoptahydrant.org'}
|
||||
|
||||
# Enable threaded mode
|
||||
# config.threadsafe!
|
||||
|
@ -46,6 +50,5 @@ AdoptAHydrant::Application.configure do
|
|||
|
||||
# Send deprecation notices to registered listeners
|
||||
config.active_support.deprecation = :notify
|
||||
|
||||
config.action_mailer.default_url_options = {:host => 'localhost:3000'}
|
||||
end
|
||||
|
||||
|
|
|
@ -7,7 +7,11 @@ AdoptAHydrant::Application.configure do
|
|||
# and recreated between test runs. Don't rely on the data there!
|
||||
config.cache_classes = true
|
||||
|
||||
# Log error messages when you accidentally call methods on nil.
|
||||
# Configure static asset server for tests with Cache-Control for performance
|
||||
config.serve_static_assets = true
|
||||
config.static_cache_control = "public, max-age=3600"
|
||||
|
||||
# Log error messages when you accidentally call methods on nil
|
||||
config.whiny_nils = true
|
||||
|
||||
# Show full error reports and disable caching
|
||||
|
@ -24,6 +28,7 @@ AdoptAHydrant::Application.configure do
|
|||
# The :test delivery method accumulates sent emails in the
|
||||
# ActionMailer::Base.deliveries array.
|
||||
config.action_mailer.delivery_method = :test
|
||||
config.action_mailer.default_url_options = {:host => 'localhost:3000'}
|
||||
|
||||
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
||||
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
||||
|
@ -32,6 +37,4 @@ AdoptAHydrant::Application.configure do
|
|||
|
||||
# Print deprecation notices to the stderr
|
||||
config.active_support.deprecation = :stderr
|
||||
|
||||
config.action_mailer.default_url_options = {:host => 'adoptahydrant.com'}
|
||||
end
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
#
|
||||
# This file contains the settings for ActionController::ParametersWrapper
|
||||
# which will be enabled by default in the upcoming version of Ruby on Rails.
|
||||
|
||||
# Enable parameter wrapping for JSON. You can disable this by set :format to empty array.
|
||||
ActionController::Base.wrap_parameters :format => [:json]
|
||||
|
||||
# Disable root element in JSON by default.
|
||||
if defined?(ActiveRecord)
|
||||
ActiveRecord::Base.include_root_in_json = false
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
# Sample localization file for English. Add more files in this directory for other locales.
|
||||
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
||||
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
||||
|
||||
en:
|
||||
hello: "Hello world"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
User-Agent: *
|
||||
Disallow: /
|
||||
Allow: /$
|
||||
# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
|
||||
#
|
||||
# To ban all spiders from the entire site uncomment the next two lines:
|
||||
# User-Agent: *
|
||||
# Disallow: /
|
||||
|
|