Module: ReadOnly::FormHelper
- Defined in:
- lib/read_only.rb
Instance Method Summary collapse
Instance Method Details
#read_only(object_name, method, options = {}) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/read_only.rb', line 6 def read_only object_name, method, ={} [:value] = Rails.application.(method).generate([:value]) if .key?(:value) label = label(object_name, "_#{method}") input = text_field(object_name, "_#{method}", ) content_tag(:div, label + tag(:br) + input, style: 'margin: 5px 0; display: none') end |