Sha256: caff3c1474399096ac45381795946ca17d030c982ec590bbca05d665222be50a

Contents?: true

Size: 999 Bytes

Versions: 1

Compression:

Stored size: 999 Bytes

Contents

# override rails extra_tags_for_form method wich creates hidden special form
# fields -> method and auth_token
# so they don't use inline styles anymore
# From:
#   <div style="margin:0;padding:0"><input name="authenticity_token"
# To:
#   <div><input name="authenticity_token"
module ActionView::Helpers::FormTagHelper
  private
  # overridden method to kill inline styles
  # from actionpack-2.1.0/lib/action_view/helpers/form_tag_helper.rb
  #def extra_tags_for_form(html_options)
  #  case method = html_options.delete("method").to_s
  #    when /^get$/i # must be case-insentive, but can't use downcase as might be nil
  #      html_options["method"] = "get"
  #      ''
  #    when /^post$/i, "", nil
  #      html_options["method"] = "post"
  #      protect_against_forgery? ? content_tag(:div, token_tag) : ''
  #    else
  #      html_options["method"] = "post"
  #      content_tag(:div, tag(:input, :type => "hidden", :name => "_method", :value => method) + token_tag)
  #  end
  #end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
king_views-1.2.0 king_form/lib/king_form/overrides.rb