scinote-web/app/serializers/step_table_serializer.rb
2022-05-04 10:36:13 +02:00

17 lines
317 B
Ruby

# frozen_string_literal: true
class StepTableSerializer < ActiveModel::Serializer
include Rails.application.routes.url_helpers
attributes :name, :urls
def urls
return if object.destroyed?
object.reload unless object.step
{
delete_url: step_table_path(object.step, object)
}
end
end