Skip to content

Commit 5c34954

Browse files
committed
for Rails 3.0.7, conform to app generated by template
1 parent 8d7cce2 commit 5c34954

File tree

5 files changed

+25
-18
lines changed

5 files changed

+25
-18
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# Ignore these files when commiting to a git repository
33
#
44
# The original version of this file is found here:
5-
# https://github.com/fortuity/rails3-gitignore/raw/master/gitignore.txt
5+
# https://github.com/RailsApps/rails3-application-templates/raw/master/files/gitignore.txt
66
#
77
# Corrections? Improvements? Create a GitHub issue:
8-
# https://github.com/fortuity/rails3-gitignore/issues
8+
# http://github.com/RailsApps/rails3-application-templates/issues
99
#----------------------------------------------------------------------------
1010

1111
# bundler state

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source 'http://rubygems.org'
22
gem 'rails', '3.0.7'
33
gem 'sqlite3'
4-
gem 'rake', '0.8.7'
4+
gem "rake", "0.8.7"
55
gem "rspec-rails", "2.5.0", :group => [:development, :test]
66
gem "factory_girl_rails", "1.1.beta1", :group => :test
77
gem "cucumber-rails", "0.4.1", :group => :test

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ GEM
4444
childprocess (0.1.9)
4545
ffi (~> 1.0.6)
4646
configuration (1.2.0)
47-
cucumber (0.10.2)
47+
cucumber (0.10.3)
4848
builder (>= 2.1.2)
4949
diff-lcs (>= 1.1.2)
50-
gherkin (>= 2.3.5)
50+
gherkin (>= 2.3.8)
5151
json (>= 1.4.6)
5252
term-ansicolor (>= 1.0.5)
5353
cucumber-rails (0.4.1)
@@ -68,7 +68,7 @@ GEM
6868
factory_girl (~> 2.0.0.beta)
6969
rails (>= 3.0.0)
7070
ffi (1.0.9)
71-
gherkin (2.3.8)
71+
gherkin (2.3.9)
7272
json (>= 1.4.6)
7373
i18n (0.5.0)
7474
json (1.5.1)
@@ -85,7 +85,7 @@ GEM
8585
nokogiri (1.4.4)
8686
orm_adapter (0.0.5)
8787
polyglot (0.3.1)
88-
rack (1.2.2)
88+
rack (1.2.3)
8989
rack-mount (0.6.14)
9090
rack (>= 1.0.0)
9191
rack-test (0.5.7)

config/database.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ development:
99
# Warning: The database defined as "test" will be erased and
1010
# re-generated from your development database when you run "rake".
1111
# Do not set this db to the same as development or production.
12-
test:
12+
test: &test
1313
adapter: sqlite3
1414
database: db/test.sqlite3
1515
pool: 5
@@ -20,3 +20,6 @@ production:
2020
database: db/production.sqlite3
2121
pool: 5
2222
timeout: 5000
23+
24+
cucumber:
25+
<<: *test

public/javascripts/rails.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@
112112
} else {
113113
method = element.data('method');
114114
url = element.attr('href');
115-
data = null;
116-
}
115+
data = element.data('params') || null;
116+
}
117117

118118
rails.ajax({
119119
url: url, type: method || 'GET', data: data, dataType: dataType,
@@ -181,13 +181,16 @@
181181
});
182182
},
183183

184-
/* If message provided in 'data-confirm' attribute:
185-
- fires `confirm` event
186-
- shows the confirm dialog
187-
- fires the `confirmed` event
188-
and returns true if no function stopped the chain and user chose yes; false otherwise.
189-
Attaching a handler to the element's `confirm` event that returns false cancels the confirm dialog.
190-
*/
184+
/* For 'data-confirm' attribute:
185+
- Fires `confirm` event
186+
- Shows the confirmation dialog
187+
- Fires the `confirm:complete` event
188+
189+
Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
190+
Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
191+
Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
192+
return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
193+
*/
191194
allowAction: function(element) {
192195
var message = element.data('confirm'),
193196
answer = false, callback;
@@ -221,6 +224,7 @@
221224

222225
// Helper function, needed to provide consistent behavior in IE
223226
stopEverything: function(e) {
227+
$(e.target).trigger('ujs:everythingStopped');
224228
e.stopImmediatePropagation();
225229
return false;
226230
},
@@ -268,7 +272,7 @@
268272

269273
// skip other logic when required values are missing or file upload is present
270274
if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
271-
return !remote;
275+
return rails.stopEverything(e);
272276
}
273277

274278
if (remote) {

0 commit comments

Comments
 (0)