Sha256: 43fddab683588c387ebc401411a35737c382759ba0554bd3415414f08dcfa61a

Contents?: true

Size: 355 Bytes

Versions: 7

Compression:

Stored size: 355 Bytes

Contents

# Special kind of input field that shows the editable value as plain text, not
# with a form widget. Handy when you want to indicate the field is not
# editable.
#
# @example
#   f.input :my_attribute, as: :static
class StaticInput < SimpleForm::Inputs::Base
  def input
    content_tag :span, object.send(attribute_name), class: 'static-field'
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stationed-0.6.0 lib/stationed/generators/templates/static_input.rb
stationed-0.5.0 lib/stationed/generators/templates/static_input.rb
stationed-0.4.0 lib/stationed/generators/templates/static_input.rb
stationed-0.3.0 lib/stationed/generators/templates/static_input.rb
stationed-0.2.0 lib/stationed/generators/templates/static_input.rb
stationed-0.1.0 lib/stationed/generators/templates/static_input.rb
stationed-0.0.1 lib/stationed/generators/templates/static_input.rb