Class: Tuttle::ActiveModelSerializersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tuttle/active_model_serializers_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/tuttle/active_model_serializers_controller.rb', line 7

def index
  @models = ActiveRecord::Base.descendants
  @models.sort_by!(&:name)

  @serializers = ::ActiveModel::Serializer.descendants
  @serializers.sort_by!(&:name)

  if defined?(ActiveModelSerializers)
    render 'index'
  else
    render 'index9'
  end
end