Permalink
Browse files

Upgrade to Rails 3.1.0.beta1

  • Loading branch information...
1 parent f9ec021 commit 33b36c97e8f39cd943cf805c6030e3c60c9e80a5 @sferik sferik committed May 6, 2011
View
@@ -3,4 +3,4 @@ db/*.sqlite3
log/*.log
tmp/
.DS_Store
-.rvmrc
+.rvmrc
View
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
View
@@ -1,86 +1,121 @@
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)
PLATFORMS
ruby
DEPENDENCIES
+ coffee-script
devise
geokit
+ jquery-rails
pg
- rails
+ rails (= 3.1.0.beta1)
+ sass
sqlite3
+ turn
+ uglifier
View
@@ -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
File renamed without changes
File renamed without changes
File renamed without changes
@@ -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)
File renamed without changes.
@@ -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 @@ def show
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 @@ def list
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 @@ def create
else
expire_session_data_after_sign_in!
end
- render(:json => resource)
+ respond_with resource
else
clean_up_passwords(resource)
render(:json => {"errors" => resource.errors})
File renamed without changes.
View
No changes.
@@ -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 %>
View
@@ -30,13 +30,24 @@ class Application < Rails::Application
# 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,26 +3,23 @@
# 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.
config.whiny_nils = true
# 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
-
Oops, something went wrong.

0 comments on commit 33b36c9

Please sign in to comment.