jjzjj

ruby-on-rails - 使用 RABL 和 Draper 渲染 to_json

我的Ticket模型应用程序中有一些相当复杂的JSON响应,我希望我的TicketDecorator能够构建这些响应。但是,我已经为我的系统设置和API,并使用RABL构建这些JSON响应,所以我想重用我已经创建的模板。我想知道是否可以从TicketDecorator中的方法中呈现RABL模板,如下所示:这是我的RABL模板tickets/show.json.rablobject@ticketattributes:id,:link,:reported_ago_in_words_with_reporter,:last_updated_in_words_with_updater,:prio
12