def slug_field(method, options = {})
      pattern = options.delete(:pattern)
      preview_value = self.object.send(method).try(:parameterize).presence || "*"
      render(partial:"admin/shared/forms/slug_field", locals: {
        f: self,
        method: method,
        options: options,
        preview_value: preview_value,
        pattern: (pattern || "/blog-example/*")
      })
    end
def slug_field(method, options = {})
      pattern = options.delete(:pattern)
      preview_value = self.object.send(method).try(:parameterize).presence || "*"
      render(partial:"admin/shared/forms/slug_field", locals: {
        f: self,
        method: method,
        options: options,
        preview_value: preview_value,
        pattern: (pattern || "/blog-example/*")
      })
    end
Returns a text field that parameterizes its input as users type
 and renders it into the given preview template. Useful for
 demonstrating the value of a URL or other sluggified text.

 #### Special Options

 - `:pattern` - Should be a string that includes an asterisk (`*`)
   character. As the user types, the asterisk will be replaced with
   a parameterized version of the text in the text box and shown
   in a preview area below the field.
   The default is `"/blog-example/*"`.

 Other options are forwarded to `text_field`.