Class: ActiveStorageDashboard::VariantRecordsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ActiveStorageDashboard::VariantRecordsController
- Defined in:
- app/controllers/active_storage_dashboard/variant_records_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/active_storage_dashboard/variant_records_controller.rb', line 5 def index if defined?(ActiveStorage::VariantRecord) @variant_records = paginate(ActiveStorage::VariantRecord.order(id: :desc)) @total_count = ActiveStorage::VariantRecord.count else @variant_records = [] @total_count = 0 end end |
#show ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/controllers/active_storage_dashboard/variant_records_controller.rb', line 15 def show if defined?(ActiveStorage::VariantRecord) @variant_record = ActiveStorage::VariantRecord.find(params[:id]) @blob = @variant_record.blob else redirect_to root_path, alert: "Variant Records are not available in this Rails version" end end |