Created
March 28, 2019 09:09
-
-
Save MaryKuz/06a4af9586e6198efc0c7c665d407161 to your computer and use it in GitHub Desktop.
create a new decorator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProductDecorator < Draper::Decorator | |
delegate_all | |
def as_json *args | |
{ | |
id: id, | |
name: name, | |
price: price, | |
description: description | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment