instance method as_json

Ruby on Rails edge

Since edge

Signature

as_json(options = nil)

Returns the attachment record’s JSON representation, or nil when no attachment is present.

Parameters

options opt = nil
Source
# File activestorage/lib/active_storage/attached/one.rb, line 50
    def as_json(options = nil)
      attached? ? attachment.as_json(options) : nil
    end

Defined in activestorage/lib/active_storage/attached/one.rb line 50 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveStorage::Attached::One

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close