roda-component 0.1.58 → 0.1.59

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: eeb1f0d44fbbcdea6edeafa5f917eaebd6dc0604
4
- data.tar.gz: f9877e070527161bd0e9edd1ac8a1479b35e426e
3
+ metadata.gz: be3d72ffbca819c4a72897b8b253786611c03e26
4
+ data.tar.gz: ddae896932ab4212f4efad80e01b8f2af9ce909e
5
5
  SHA512:
6
- metadata.gz: 9d3e7bfa0bcd191435b2c91877812f52267498de279f55de82ddc9a427b67c31781fd62eb0ef5f6b1ac14c215da48db36726fda0e9596e7b15345bf2c66365fe
7
- data.tar.gz: fd1b4871946cdf76db4d36580b673b9ffd8c34678c2031411e0ca7108250e083a366ca962ebeb962e5f1f7821833882cc23a64764f8df01fe7ae6a77b2ec4eac
6
+ metadata.gz: 8a4902134175f8354faf880cf946e52eeda7b9f9c80b616a7a9672da39a19db2e5cdb89c5b54250b8476957a78d2dcdd46510dc588d3bab04f90ba3a6b2a9feb
7
+ data.tar.gz: 2cd5e37e0903671d7837fa54313caf8a845b92a352bb7938ccf74f1015a47d88391b18fa82a143714b230dec8b839a196dff737df718c40dc2e510d70e8d1063
@@ -1,5 +1,5 @@
1
1
  class Roda
2
2
  class Component
3
- VERSION = "0.1.58"
3
+ VERSION = "0.1.59"
4
4
  end
5
5
  end
@@ -175,6 +175,8 @@ class Roda
175
175
  end
176
176
 
177
177
  if trigger || action
178
+ comp_response = '' if js && !comp_response
179
+
178
180
  load_component_js comp, action, options
179
181
 
180
182
  if js && comp_response.is_a?(Roda::Component::DOM)
@@ -269,7 +271,14 @@ class Roda
269
271
 
270
272
  on self.class.component_route_regex do |comp, type, action|
271
273
  body = scope.request.body.read
272
- data = body ? JSON.parse(body) : {}
274
+
275
+ begin
276
+ data = body ? JSON.parse(body) : {}
277
+ rescue
278
+ data = {}
279
+ end
280
+
281
+ data.merge! scope.request.params unless data.is_a? Array
273
282
 
274
283
  if data.is_a? Array
275
284
  data = {args: data}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-component
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.58
4
+ version: 0.1.59
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj