Module: Api::ResourcesController::Base::FirstAction
- Extended by:
- ActiveSupport::Concern
- Included in:
- Api::ResourcesController::Base
- Defined in:
- app/controllers/api/resources_controller/base.rb
Instance Method Summary collapse
Instance Method Details
#first ⇒ Object
258 259 260 261 262 263 264 265 266 |
# File 'app/controllers/api/resources_controller/base.rb', line 258 def first respond_to do |format| if @resource.nil? format.json { render json: nil } else format.json { render json: [serialize_resource(@resource)] } end end end |