Module: BMC::FormBackUrl

Defined in:
lib/bmc/form_back_url.rb

Instance Method Summary collapse

Instance Method Details

#back_url_tagObject



2
3
4
5
6
7
8
# File 'lib/bmc/form_back_url.rb', line 2

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

#form_tag_with_body(html_options, content) ⇒ Object



10
11
12
13
14
15
# File 'lib/bmc/form_back_url.rb', line 10

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