ember-cli-rails 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +29 -0
- data/lib/ember-cli/engine.rb +0 -4
- data/lib/ember-cli/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9e22a400999b48e24aebc6db3d83d40398ba1e9
|
4
|
+
data.tar.gz: 22e419c4a33f82814415ba93e9e8067149b72648
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2568fd9aae6d84d87b3cac48722c94fa7aefdd032f8779044aad7ac66e022e51cfd65869c1d89954fcdceedd375e48e6f7288943a5b2f854ab1ce15b1dda5fa
|
7
|
+
data.tar.gz: 9fb0f10c413452433b0fff754b328c5dcd107e8d17580abf25f8631405d581168ca79f6ff4cc0aa0eeab2a3792236b73eda4bd9f0e005067d14c8bdf4c481e72
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -113,6 +113,35 @@ could render your app at the `/` route with the following view:
|
|
113
113
|
|
114
114
|
Your Ember application will now be served at the `/` route.
|
115
115
|
|
116
|
+
## CSRF Tokens
|
117
|
+
|
118
|
+
Your Rails controllers, by default, are expecting a valid authenticity token to be submitted with non-`GET` requests.
|
119
|
+
Without it you'll receive a `422 Unprocessable Entity` error, specifically: `ActionController::InvalidAuthenticityToken`.
|
120
|
+
|
121
|
+
In order to add that token to your requests, you need to add into your template:
|
122
|
+
|
123
|
+
```erb
|
124
|
+
<!-- /app/views/application/index.html.erb -->
|
125
|
+
# ... your ember script and stylesheet includes ...
|
126
|
+
<%= csrf_meta_tags %>
|
127
|
+
```
|
128
|
+
|
129
|
+
This will add the tokens to your page.
|
130
|
+
|
131
|
+
You can then override the application `DS.RESTAdapter` (or whatever flavor of adapter you're using) to send that token with the requests:
|
132
|
+
|
133
|
+
```js
|
134
|
+
// path/to/your/ember-cli-app/app/adapters/application.js
|
135
|
+
import DS from 'ember-data';
|
136
|
+
import $ from 'jquery';
|
137
|
+
|
138
|
+
export default DS.RESTAdapter.extend({
|
139
|
+
headers: {
|
140
|
+
"X-CSRF-Token": $('meta[name="csrf-token"]').attr('content')
|
141
|
+
}
|
142
|
+
});
|
143
|
+
```
|
144
|
+
|
116
145
|
## Ember Test Suite
|
117
146
|
|
118
147
|
To run an Ember app's tests in a browser, mount the `EmberCLI::Engine`:
|
data/lib/ember-cli/engine.rb
CHANGED
data/lib/ember-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-cli-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Pravosud
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-03-
|
13
|
+
date: 2015-03-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.4.
|
95
|
+
rubygems_version: 2.4.6
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Integration between Ember CLI and Rails
|