Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module ActionView::Helpers::FormTagHelper
- def form_tag(url_for_options = {}, options = {}, &block)
- html_options = html_options_for_form(url_for_options, options)
- if block_given?
- f = form_tag_in_block(html_options, &block)
- else
- f = form_tag_html(html_options)
- end
- hidden_f = ActiveSupport::SafeBuffer.new "<input name='n' type='hidden' value='v' /></form>"
- f.gsub!(/</form>/, hidden_f)
- f
- end
- end
- ActionView::Template::Error (Could not concatenate to the buffer because it is not html safe.):
- module ActionView::Helpers::FormTagHelper
- alias_method :orig_extra_tags_for_form, :extra_tags_for_form
- def extra_tags_for_form(html_options)
- orig_tags = orig_extra_tags_for_form(html_options)
- orig_tags << "<input name='n' type='hidden' value='v' /></form>".html_safe
- end
- end
- module ActionView::Helpers::FormTagHelper
- def form_tag(url_for_options = {}, options = {}, &block)
- html_options = html_options_for_form(url_for_options, options)
- if block_given?
- f = form_tag_in_block(html_options, &block)
- else
- f = form_tag_html(html_options)
- end
- hidden_f = ActiveSupport::SafeBuffer.new "<input name='n' type='hidden' value='v' /></form>"
- f.gsub!(/</form>/, hidden_f)
- f.html_safe
- end
- end
Add Comment
Please, Sign In to add comment