Displaying 5 results from an estimated 5 matches for "safe_concat".
2011 Sep 13
3
Accessing Rails helper method with_output_buffer
...'s the helper:
==========
module MyHelper
class MyFormBuilder < ActionView::Helpers::FormBuilder
def my_dummy_div_wrapper(&block)
output = "<div>".html_safe
# here I should use with_output_buffer to correctly get the
block''s output
output.safe_concat(with_output_buffer &block)
output.safe_concat "</div>"
output
end
end
end
==========
Inside the MyFormBuilder methods, there''s no with_output_buffer method
defined so I cannot use it (and a bunch of other Rails helpers; cannot
render a partial, etc....
2010 Nov 20
0
Enabling preprocessing in Erubis makes views much faster
...d be needed to make that
work.
https://gist.github.com/707461
module ActionView
class Base
def get_binding;return binding;end
end
class Template
module Handlers
class Erubis < ::Erubis::Eruby
def add_expr_debug(src, code)
src << "@output_buffer.safe_concat(''" <<
escape_text(eval(code,ActionView::Base.new.get_binding).to_s) << "'');"
end
end
end
end
end
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this gro...
2011 Jun 26
1
ActionView::Template::Error (Cannot modify SafeBuffer in place):
...bb*", ''</b>'')
text.gsub!("*r*", ''<span class=red>'')
text.gsub!("*rr*", ''</span>'')
text.gsub!("*sp*", '' '')
text.insert 0, start_tag
text.html_safe.safe_concat("</p>")
end
I don''t understand well enough what changed between 3.0.3 and 3.0.9 to
understand what I should change in this function and what part is now
wrong.
Can anyone help? Thanks!
Cedric Tineo
--
You received this message because you are subscribed to the Google...
2012 Nov 16
0
With streaming on, closed client connections cause Fatal Broken Pipe errors
.../home/dan/dev/skweb/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_view/buffers.rb:31:in
`call''
/home/dan/dev/skweb/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_view/buffers.rb:31:in
`safe_concat''
/home/dan/dev/skweb/app/views/layouts/application.html.erb:47:in
`_app_views_layouts_application_html_erb__3293108995857455051_100497760''
/home/dan/dev/skweb/vendor/bundle/ruby/1.9.1/gems/a...
2011 Feb 17
16
Unindent ERB output
Hi all,
I''d like to unindent a block of ERB specifically to combat the extra
spacing being added to content inside <textarea> by the browser. Is
there such a feature in ERB?
I shall denote indentation with underscores in the pseudo code example
below.
Thanks in advance,
Khoan.
myview.erb:
<html ...>
__<%= render ''form'' %>
</html>