Permalink
Browse files

for Rails 3.0.7, conform to app generated by template

  • Loading branch information...
1 parent 8d7cce2 commit 5c349545b1dd369f092caca1afe738947c04f6cb @fortuity fortuity committed May 24, 2011
Showing with 25 additions and 18 deletions.
  1. +2 −2 .gitignore
  2. +1 −1 Gemfile
  3. +4 −4 Gemfile.lock
  4. +4 −1 config/database.yml
  5. +14 −10 public/javascripts/rails.js
View
@@ -2,10 +2,10 @@
# Ignore these files when commiting to a git repository
#
# The original version of this file is found here:
-# https://github.com/fortuity/rails3-gitignore/raw/master/gitignore.txt
+# https://github.com/RailsApps/rails3-application-templates/raw/master/files/gitignore.txt
#
# Corrections? Improvements? Create a GitHub issue:
-# https://github.com/fortuity/rails3-gitignore/issues
+# http://github.com/RailsApps/rails3-application-templates/issues
#----------------------------------------------------------------------------
# bundler state
View
@@ -1,7 +1,7 @@
source 'http://rubygems.org'
gem 'rails', '3.0.7'
gem 'sqlite3'
-gem 'rake', '0.8.7'
+gem "rake", "0.8.7"
gem "rspec-rails", "2.5.0", :group => [:development, :test]
gem "factory_girl_rails", "1.1.beta1", :group => :test
gem "cucumber-rails", "0.4.1", :group => :test
View
@@ -44,10 +44,10 @@ GEM
childprocess (0.1.9)
ffi (~> 1.0.6)
configuration (1.2.0)
- cucumber (0.10.2)
+ cucumber (0.10.3)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
- gherkin (>= 2.3.5)
+ gherkin (>= 2.3.8)
json (>= 1.4.6)
term-ansicolor (>= 1.0.5)
cucumber-rails (0.4.1)
@@ -68,7 +68,7 @@ GEM
factory_girl (~> 2.0.0.beta)
rails (>= 3.0.0)
ffi (1.0.9)
- gherkin (2.3.8)
+ gherkin (2.3.9)
json (>= 1.4.6)
i18n (0.5.0)
json (1.5.1)
@@ -85,7 +85,7 @@ GEM
nokogiri (1.4.4)
orm_adapter (0.0.5)
polyglot (0.3.1)
- rack (1.2.2)
+ rack (1.2.3)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.7)
View
@@ -9,7 +9,7 @@ development:
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
-test:
+test: &test
adapter: sqlite3
database: db/test.sqlite3
pool: 5
@@ -20,3 +20,6 @@ production:
database: db/production.sqlite3
pool: 5
timeout: 5000
+
+cucumber:
+ <<: *test
@@ -112,8 +112,8 @@
} else {
method = element.data('method');
url = element.attr('href');
- data = null;
- }
+ data = element.data('params') || null;
+ }
rails.ajax({
url: url, type: method || 'GET', data: data, dataType: dataType,
@@ -181,13 +181,16 @@
});
},
- /* If message provided in 'data-confirm' attribute:
- - fires `confirm` event
- - shows the confirm dialog
- - fires the `confirmed` event
- and returns true if no function stopped the chain and user chose yes; false otherwise.
- Attaching a handler to the element's `confirm` event that returns false cancels the confirm dialog.
- */
+ /* For 'data-confirm' attribute:
+ - Fires `confirm` event
+ - Shows the confirmation dialog
+ - Fires the `confirm:complete` event
+
+ Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
+ Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
+ Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
+ return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
+ */
allowAction: function(element) {
var message = element.data('confirm'),
answer = false, callback;
@@ -221,6 +224,7 @@
// Helper function, needed to provide consistent behavior in IE
stopEverything: function(e) {
+ $(e.target).trigger('ujs:everythingStopped');
e.stopImmediatePropagation();
return false;
},
@@ -268,7 +272,7 @@
// skip other logic when required values are missing or file upload is present
if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
- return !remote;
+ return rails.stopEverything(e);
}
if (remote) {

0 comments on commit 5c34954

Please sign in to comment.