class Formular::Path
Public Instance Methods
to_encoded_id()
click to toggle source
to_encoded_name()
click to toggle source
name attribute without model…
# File lib/formular/path.rb, line 6 def to_encoded_name map.with_index do |segment, i| first_or_last = i == 0 || i == size if first_or_last segment.is_a?(Array) ? "#{segment.first}[]" : segment else segment.is_a?(Array) ? "[#{segment.first}][]" : "[#{segment}]" end end.join('') end