Class: Koi::Helpers::AttributeTypes::EnumType

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/koi/helpers/attribute_types.rb

Instance Attribute Summary

Attributes inherited from Base

#attribute

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Koi::Helpers::AttributeTypes::Base

Instance Method Details

#collection_attributeObject



155
156
157
# File 'lib/generators/koi/helpers/attribute_types.rb', line 155

def collection_attribute
  %(attribute :#{attribute.name}, :enum)
end

#govuk_inputObject



143
144
145
# File 'lib/generators/koi/helpers/attribute_types.rb', line 143

def govuk_input
  %(<%= form.govuk_enum_select :#{attribute.name} %>)
end

#index_rowObject



147
148
149
# File 'lib/generators/koi/helpers/attribute_types.rb', line 147

def index_row
  %(<% row.enum :#{attribute.name} %>)
end

#show_rowObject



151
152
153
# File 'lib/generators/koi/helpers/attribute_types.rb', line 151

def show_row
  %(<% row.enum :#{attribute.name} %>)
end