Sha256: 29cb8824aac2b5dffa0bec27cb8bacb2578fbb35e6d3ad9091855e69917c39ee

Contents?: true

Size: 555 Bytes

Versions: 10

Compression:

Stored size: 555 Bytes

Contents

# frozen_string_literal: true

# Tag for text content that is going to be rendered using number input
#   {{ cms:number identifier }}
#
class Occams::Content::Tag::Number < Occams::Content::Tag::Fragment
  def form_field(object_name, view, index)
    name    = "#{object_name}[fragments_attributes][#{index}][content]"
    options = { id: form_field_id, class: 'form-control' }
    input   = view.send(:number_field_tag, name, content, options)

    yield input
  end
end

Occams::Content::Renderer.register_tag(
  :number, Occams::Content::Tag::Number
)

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
occams-1.0.7.3 lib/occams/content/tags/number.rb
occams-1.0.7.2 lib/occams/content/tags/number.rb
occams-1.0.7.1 lib/occams/content/tags/number.rb
occams-1.0.7 lib/occams/content/tags/number.rb
occams-1.0.6.1 lib/occams/content/tags/number.rb
occams-1.0.6 lib/occams/content/tags/number.rb
occams-1.0.5 lib/occams/content/tags/number.rb
occams-1.0.4 lib/occams/content/tags/number.rb
occams-1.0.3 lib/occams/content/tags/number.rb
occams-1.0.2 lib/occams/content/tags/number.rb