mikeycgto-sinatra-rest 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/sinatra/rest/rest.yaml +10 -2
  2. metadata +3 -8
@@ -30,7 +30,11 @@
30
30
  unless @SINGULAR.invalid?
31
31
  redirect url_for_PLURAL_show(@SINGULAR), 'SINGULAR created'
32
32
  else
33
- throw :halt, [500, @SINGULAR.errors.full_messages.join("\n")]
33
+ if request.xhr?
34
+ throw :halt, [500, @SINGULAR.errors.full_messages.join("\n")]
35
+ else
36
+ RENDERER :'PLURAL/new', options
37
+ end
34
38
  end
35
39
 
36
40
  :show:
@@ -71,7 +75,11 @@
71
75
  unless @SINGULAR.invalid?
72
76
  redirect url_for_PLURAL_show(@SINGULAR), 'SINGULAR updated'
73
77
  else
74
- throw :halt, [500, @SINGULAR.errors.full_messages.join("\n")]
78
+ if request.xhr?
79
+ throw :halt, [500, @SINGULAR.errors.full_messages.join("\n")]
80
+ else
81
+ RENDERER :'PLURAL/edit', options
82
+ end
75
83
  end
76
84
  end
77
85
 
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mikeycgto-sinatra-rest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 4
9
- - 1
10
- version: 0.4.1
8
+ - 2
9
+ version: 0.4.2
11
10
  platform: ruby
12
11
  authors:
13
12
  - blindgaenger
@@ -29,7 +28,6 @@ dependencies:
29
28
  requirements:
30
29
  - - ">="
31
30
  - !ruby/object:Gem::Version
32
- hash: 57
33
31
  segments:
34
32
  - 0
35
33
  - 9
@@ -45,7 +43,6 @@ dependencies:
45
43
  requirements:
46
44
  - - ">="
47
45
  - !ruby/object:Gem::Version
48
- hash: 11
49
46
  segments:
50
47
  - 0
51
48
  - 5
@@ -83,7 +80,7 @@ files:
83
80
  - test/views/words/index.haml
84
81
  - test/views/words/new.haml
85
82
  - test/views/words/show.haml
86
- has_rdoc: true
83
+ has_rdoc: "false"
87
84
  homepage: http://github.com/mikeycgto/sinatra-rest
88
85
  licenses: []
89
86
 
@@ -97,7 +94,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
94
  requirements:
98
95
  - - ">="
99
96
  - !ruby/object:Gem::Version
100
- hash: 3
101
97
  segments:
102
98
  - 0
103
99
  version: "0"
@@ -106,7 +102,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
102
  requirements:
107
103
  - - ">="
108
104
  - !ruby/object:Gem::Version
109
- hash: 3
110
105
  segments:
111
106
  - 0
112
107
  version: "0"