dominiquebrezinski-sinatra-rest 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/sinatra/rest.rb CHANGED
@@ -136,7 +136,8 @@ module Sinatra
136
136
  def controller_template(route)
137
137
  t = <<-RUBY
138
138
  def PLURAL_NAME(options=params)
139
- filter_model_params(options).to_json
139
+ mp = filter_model_params(options)
140
+ CONTROL
140
141
  end
141
142
  RUBY
142
143
  replace_variables(t, route)
@@ -5,7 +5,7 @@
5
5
  :control: |-
6
6
  @PLURAL = call_model_method(MODEL, :all, mp)
7
7
  :render: |-
8
- RENDERER :'PLURAL/index', options
8
+ @PLURAL.to_json
9
9
 
10
10
  :new:
11
11
  :verb: GET
@@ -13,7 +13,7 @@
13
13
  :control: |-
14
14
  @SINGULAR = call_model_method(MODEL, :new, mp)
15
15
  :render: |-
16
- RENDERER :'PLURAL/new', options
16
+ @SINGULAR.to_json
17
17
 
18
18
  :create:
19
19
  :verb: POST
@@ -33,7 +33,7 @@
33
33
  if @SINGULAR.nil?
34
34
  throw :halt, [404, 'SINGULAR not found']
35
35
  else
36
- RENDERER :'PLURAL/show', options
36
+ @SINGULAR.to_json
37
37
  end
38
38
 
39
39
  :edit:
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 5
9
- version: 0.3.5
8
+ - 6
9
+ version: 0.3.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - blindgaenger