Class: Para::AttributeField::FriendlyId

Inherits:
Base
  • Object
show all
Defined in:
lib/para/attribute_field/friendly_id.rb

Instance Attribute Summary

Attributes inherited from Base

#field_method, #field_type, #model, #name, #options, #type

Instance Method Summary collapse

Methods inherited from Base

#attribute_column_path, #determine_name_and_field_method!, #excerptable_value?, #field_name, field_option, #field_options, field_types, #initialize, register, #searchable?, #type?, #value_for

Constructor Details

This class inherits a constructor from Para::AttributeField::Base

Instance Method Details

#parse_input(params, resource) ⇒ Object

Set empty string as nil to allow default friendly id methods to generate the slug when the field is empty



8
9
10
# File 'lib/para/attribute_field/friendly_id.rb', line 8

def parse_input(params, resource)
  params[slug_column] = nil if slug_column && params[slug_column] == ''
end