Sha256: 7ab1d0f5902c292c27c2f8cd4a751cec45f08bbee69c2fb17e64fd2556cd4fe7

Contents?: true

Size: 445 Bytes

Versions: 8

Compression:

Stored size: 445 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

8 entries across 8 versions & 1 rubygems

Version Path
bmc-1.3.2 lib/bmc/form_back_url.rb
bmc-1.3.1 lib/bmc/form_back_url.rb
bmc-1.3.0 lib/bmc/form_back_url.rb
bmc-1.2.1 lib/bmc/form_back_url.rb
bmc-1.2.0 lib/bmc/form_back_url.rb
bmc-1.1.0 lib/bmc/form_back_url.rb
bmc-1.0.1 lib/bmc/form_back_url.rb
bmc-1.0.0 lib/bmc/form_back_url.rb