ember-rails 0.16.1 → 0.16.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d2bc90c8745e6458bbbeaa2c88bef7ae3678297
4
- data.tar.gz: 4e272c941dbfa2c4111e6c4fddcc9bf69a97901b
3
+ metadata.gz: 2c08a82296cfb9d04139a555ed9487758423621a
4
+ data.tar.gz: 3d026e9c756d4f975b57ae6b590a9a22e5db93d5
5
5
  SHA512:
6
- metadata.gz: cf9f95ccc1519eac9725c9d5b762edc81903385f41229471ea7b441af87851f064bf3ff51fbdb9b981b3029613f1dfe344888519570dbc9be07e7a84c7ff00dd
7
- data.tar.gz: 70173e03ac5ab815f0b845a2ae593141d34e48dd4fc83a12a51660a3e05bb1a59437773bd72eb189020fdb367f13ae8a017e4175a0cfe8f639279f897d242105
6
+ metadata.gz: 0b1b71f91f5f4467be49e88eebeb497e69bc9bfc2e87e97a7de45b35904e4a540dedc876f4f78b15d2898d305c85b83c5394deae91d5d50cc5b8bf79e0357a55
7
+ data.tar.gz: b60afeb995dc9f8a0cee2a61a9a2c4c902599acef5cc21718966a38e4d41b8ca95e397a51bfe88949b3d5983bae424d3d1e9397ef049ef88189de5fc3c97874f
data/README.md CHANGED
@@ -276,32 +276,6 @@ You can reference your component inside your other handlebars template files by
276
276
 
277
277
  {{ my-component }}
278
278
 
279
- ### A note about upgrading ember-rails and components
280
- The ember-rails project now includes generators for components. If you have an existing project and need
281
- to compile component files you will need to include the components folder as part of the asset pipeline.
282
- A typical project expects two folders for *components* related code:
283
-
284
- * `assets/javascripts/components/` to hold the component javascript source
285
- * `assets/javascripts/templates/components/` to hold the handlebars templates for your components
286
-
287
- Your asset pipeline require statements should include reference to both e.g.
288
-
289
- RailsAppName.js
290
- ```
291
- //= require_tree ./templates
292
- //= require_tree ./components
293
- ```
294
-
295
- or
296
-
297
- RailsAppName.js.coffee
298
- ```
299
- #= require_tree ./templates
300
- #= require_tree ./components
301
- ```
302
-
303
- These are automatically generated for you in new projects you when you run the `ember:bootstrap` generator.
304
-
305
279
  ## Specifying Different Versions of Ember/Handlebars/Ember-Data
306
280
 
307
281
  By default, ember-rails ships with the latest version of
@@ -351,6 +325,22 @@ or for ember-data
351
325
 
352
326
  rails generate ember:install --tag=v1.0.0-beta.2 --ember-data
353
327
 
328
+ ## CSRF Token
329
+
330
+ Rails [`protect_from_forgery`](http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html#method-i-protect_from_forgery) requires CSRF token for every XHR except GET.
331
+ The CSRF token is normally found in `app/views/layouts/application.html.*` inserted with the rails helper: [`csrf_meta_tags`](http://api.rubyonrails.org/classes/ActionView/Helpers/CsrfHelper.html#method-i-csrf_meta_tags).
332
+
333
+ When you use [jquery-ujs](https://github.com/rails/jquery-ujs),
334
+ the CSRF token will be send to rails application on every XHR automatically.
335
+ If not so, the following JavaScript is required in your code.
336
+
337
+ ``` javascript
338
+ $.ajaxPrefilter(function(options, originalOptions, xhr) {
339
+ var token = $('meta[name="csrf-token"]').attr('content');
340
+ xhr.setRequestHeader('X-CSRF-Token', token);
341
+ });
342
+ ```
343
+
354
344
  ## Note on Patches/Pull Requests
355
345
 
356
346
  1. Fork the project.
@@ -1,5 +1,5 @@
1
1
  module Ember
2
2
  module Rails
3
- VERSION = '0.16.1'
3
+ VERSION = '0.16.2'
4
4
  end
5
5
  end
@@ -38,10 +38,6 @@ module Ember
38
38
  template "router.#{engine_extension}", "#{ember_path}/router.#{engine_extension}"
39
39
  end
40
40
 
41
- def create_store_file
42
- template "store.#{engine_extension}", "#{ember_path}/store.#{engine_extension}"
43
- end
44
-
45
41
  def create_adapter_file
46
42
  template "application_adapter.#{engine_extension}", "#{ember_path}/adapters/application_adapter.#{engine_extension}"
47
43
  end
@@ -1,4 +1,3 @@
1
- //= require ./store
2
1
  //= require_tree ./adapters
3
2
  //= require_tree ./mixins
4
3
  //= require_tree ./models
@@ -1,4 +1,3 @@
1
- #= require ./store
2
1
  #= require_tree ./adapters
3
2
  #= require_tree ./mixins
4
3
  #= require_tree ./models
@@ -1,4 +1,3 @@
1
- #= require ./store
2
1
  #= require_tree ./adapters
3
2
  #= require_tree ./mixins
4
3
  #= require_tree ./models
@@ -1,4 +1,5 @@
1
1
  //= require jquery
2
+ //= require jquery_ujs
2
3
  //= require handlebars
3
4
  //= require ember
4
5
  //= require ember-data
@@ -1,4 +1,5 @@
1
1
  #= require jquery
2
+ #= require jquery_ujs
2
3
  #= require handlebars
3
4
  #= require ember
4
5
  #= require ember-data
@@ -1,4 +1,5 @@
1
1
  #= require jquery
2
+ #= require jquery_ujs
2
3
  #= require handlebars
3
4
  #= require ember
4
5
  #= require ember-data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ember-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.1
4
+ version: 0.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Pitt
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-01-01 00:00:00.000000000 Z
14
+ date: 2015-02-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: execjs
@@ -104,6 +104,9 @@ dependencies:
104
104
  - - ">"
105
105
  - !ruby/object:Gem::Version
106
106
  version: 1.0.0
107
+ - - "<"
108
+ - !ruby/object:Gem::Version
109
+ version: '3'
107
110
  type: :runtime
108
111
  prerelease: false
109
112
  version_requirements: !ruby/object:Gem::Requirement
@@ -111,6 +114,9 @@ dependencies:
111
114
  - - ">"
112
115
  - !ruby/object:Gem::Version
113
116
  version: 1.0.0
117
+ - - "<"
118
+ - !ruby/object:Gem::Version
119
+ version: '3'
114
120
  - !ruby/object:Gem::Dependency
115
121
  name: ember-data-source
116
122
  requirement: !ruby/object:Gem::Requirement
@@ -271,9 +277,6 @@ files:
271
277
  - lib/generators/templates/router.js
272
278
  - lib/generators/templates/router.js.coffee
273
279
  - lib/generators/templates/router.js.em
274
- - lib/generators/templates/store.js
275
- - lib/generators/templates/store.js.coffee
276
- - lib/generators/templates/store.js.em
277
280
  - lib/generators/templates/template.handlebars
278
281
  - lib/generators/templates/view.js
279
282
  - lib/generators/templates/view.js.coffee
@@ -1,9 +0,0 @@
1
- // Adds X-CSRF-Token to all REST requests.
2
- // Allows for the use of Rails protect_from_forgery
3
- // The CSRF Token is normally found in app/views/layouts/application.html.*
4
- // inserted with the rails helper: "csrf_meta_tags"
5
- DS.RESTAdapter.reopen({
6
- headers: {
7
- "X-CSRF-Token": $('meta[name="csrf-token"]').attr('content')
8
- }
9
- });
@@ -1,8 +0,0 @@
1
- # Adds X-CSRF-Token to all REST requests.
2
- # Allows for the use of Rails protect_from_forgery
3
- # The CSRF Token is normally found in app/views/layouts/application.html.*
4
- # inserted with the rails helper: "csrf_meta_tags"
5
- DS.RESTAdapter.reopen(
6
- headers:
7
- "X-CSRF-Token": $('meta[name="csrf-token"]').attr('content')
8
- )
@@ -1,8 +0,0 @@
1
- # Adds X-CSRF-Token to all REST requests.
2
- # Allows for the use of Rails protect_from_forgery
3
- # The CSRF Token is normally found in app/views/layouts/application.html.*
4
- # inserted with the rails helper: "csrf_meta_tags"
5
- DS.RESTAdapter.reopen(
6
- headers:
7
- "X-CSRF-Token": $('meta[name="csrf-token"]').attr('content')
8
- )