app/views/admin/application/slug/_form.html.erb
<%
object ||= f.object
attribute ||= :slug
max_length ||= object.class::SLUG_MAX_LENGTH
%>
<%= f.input attribute,
as: :string,
maxlength: max_length,
input_html: object.persisted? ? {} : {
class: 'js-slug-input',
data: { source: source }
} %>