ahc 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/ahc.gemspec +2 -2
- data/lib/ahc_helper.rb +13 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1e615cd4bc83ae89c7a962979e2164877fd9123
|
4
|
+
data.tar.gz: 1956e0abdd72e403d26af83d5a52a155c7626b2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc25b31f5bf2a7e6e7603e2c223c017b1d6e837500d55a9fa02c5f1033d68c83b03ec72dc02fc5ea97ba94ad337ce3d282dcf25e35e0736293a834b5f1fb29a0
|
7
|
+
data.tar.gz: 36e2447e6256445821700ce0779980d7a5bd6589c2707083683d7216ee3052661bb9feecc68a17cf0153209f711a4a078e19aefc21b54e992814e1f0e329b896
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
data/ahc.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "ahc"
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andriy Romanov"]
|
12
|
-
s.date = "2013-12-
|
12
|
+
s.date = "2013-12-15"
|
13
13
|
s.description = "Ahc allows you to move all your client side code to ahc server"
|
14
14
|
s.email = "judo.ras@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/ahc_helper.rb
CHANGED
@@ -24,7 +24,19 @@ module AhcInheritedResourcesHelper
|
|
24
24
|
controller = params[:controller].split('/').last
|
25
25
|
action = params[:action]
|
26
26
|
@data ||= {}
|
27
|
-
|
27
|
+
case params[:action]
|
28
|
+
when 'show'
|
29
|
+
@data['resource'] = resource
|
30
|
+
when 'index'
|
31
|
+
@data['resources'] = resources
|
32
|
+
when 'create', 'update'
|
33
|
+
params[:format] = 'json'
|
34
|
+
if resource.valid?
|
35
|
+
@data['resource'] = resource
|
36
|
+
else
|
37
|
+
@data['errors'] = resource.errors
|
38
|
+
end
|
39
|
+
end
|
28
40
|
render_ahc("#{controller}/#{action}")
|
29
41
|
end
|
30
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ahc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andriy Romanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|