File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ def field_name
8282 name . tableize . singularize
8383 end
8484
85+ def fields_name
86+ name . tableize . pluralize
87+ end
88+
8589 def pluralized_file_name
8690 name . tableize
8791 end
@@ -101,6 +105,7 @@ def create_endpoint(options = {})
101105 plural_class_name : plural_class_name ,
102106 singular_class_name : singular_class_name ,
103107 field_name : field_name ,
108+ fields_name : fields_name ,
104109 url_path : url_path ,
105110 } )
106111 display "created endpoint file #{ endpoint } "
Original file line number Diff line number Diff line change @@ -6,9 +6,8 @@ module Endpoints
66 end
77
88 get do
9- resources = uuid_paginator(<%= singular_class_name %> , args: { max: 10 })
10-
11- encode serialize(resources)
9+ <%= fields_name %> = uuid_paginator(<%= singular_class_name %> , args: { max: 10 })
10+ encode serialize(% = fields_name %)
1211 end
1312
1413 post do
You can’t perform that action at this time.
0 commit comments