I need to render out a json output from a controller and I'd like to include the thumbnail version of my images in the json.
If I render json using only
You should use something like this.
class ArtworkSerializer < ActiveModel::Serializer attributes :id, :name, :image_url def image_url object.image_url(:thumbnail) end end
Then in your JSON response, you will have an attribute
Note: You should have a version defined :thumbnail in your carrierwave uploader.