aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/record_identifier.rb
blob: bffd2a02d0a041333fab625648275a3caa72c4dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'active_support/deprecation'
require 'action_view/record_identifier'

module ActionController
  module RecordIdentifier
    MESSAGE = 'method will no longer be included by default in controllers since Rails 4.1. ' +
              'If you would like to use it in controllers, please include ' +
              'ActionView::RecodIdentifier module.'

    def dom_id(record, prefix = nil)
      ActiveSupport::Deprecation.warn 'dom_id ' + MESSAGE
      ActionView::RecordIdentifier.dom_id(record, prefix)
    end

    def dom_class(record, prefix = nil)
      ActiveSupport::Deprecation.warn 'dom_class ' + MESSAGE
      ActionView::RecordIdentifier.dom_class(record, prefix)
    end
  end
end