lib/formular/elements.rb
def method_tag
        method = options[:method]

        case method
        when /^get$/ # must be case-insensitive, but can't use downcase as might be nil
          options[:method] = 'get'
          ''
        when /^post$/, '', nil
          options[:method] = 'post'
          ''
        else
          options[:method] = 'post'
          Hidden.(value: method, name: '_method').to_s
        end
      end
# because this mutates attributes, we have to call this before rendering the start_tag
because this mutates attributes, we have to call this before rendering the start_tag
because this mutates attributes we have to call this before rendering the start_tag
def method_tag
        method = options[:method]
        case method
        when /^get$/ 
          options[:method] = 'get'
          ''
        when /^post$/, '', nil
          options[:method] = 'post'
          ''
        else
          options[:method] = 'post'
          Hidden.(value: method, name: '_method').to_s
        end
      end
def method_tag method = options [ :method ] case method when / ^get$ / options [ :method ] = 'get' '' when / ^post$ / , '' , nil options [ :method ] = 'post' '' else options [ :method ] = 'post' Hidden . ( value : method , name : '_method' ) . to_s end end
because this mutates attributes, we have to call this before rendering the start_tag
because this mutates attributes we have to call this before rendering the start_tag
# must be case-insensitive, but can't use downcase as might be nil