File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ def field_name
2727 name . tableize . singularize
2828 end
2929
30+ def fields_name
31+ name . tableize . pluralize
32+ end
33+
3034 def pluralized_file_name
3135 name . tableize
3236 end
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ def create
1010 plural_class_name : plural_class_name ,
1111 singular_class_name : singular_class_name ,
1212 field_name : field_name ,
13+ fields_name : fields_name ,
1314 url_path : url_path )
1415 display "created endpoint file #{ endpoint } "
1516 display 'add the following to lib/routes.rb:'
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