Sha256: 813c9853c92c1e4a541601bfb599a7a44c9793f1984d636ab7a7b34463373a34

Contents?: true

Size: 442 Bytes

Versions: 4

Compression:

Stored size: 442 Bytes

Contents

module BMC::FormBackUrl
  def back_url_tag
    tag.input(
      :type  => "hidden",
      :name  => "back_url",
      :value => params[:back_url].presence || request.referer,
    )
  end

  def form_tag_with_body(html_options, content)
    output = form_tag_html(html_options)
    output.safe_concat(back_url_tag)
    output << content
    output.safe_concat("</form>")
  end
end

ActionView::Helpers::FormTagHelper.prepend(BMC::FormBackUrl)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bmc-1.6.1 lib/bmc/form_back_url.rb
bmc-1.6.0 lib/bmc/form_back_url.rb
bmc-1.5.1 lib/bmc/form_back_url.rb
bmc-1.5.0 lib/bmc/form_back_url.rb