Hi!
I ran into a big problem in moving my application to Rails 3. I have a view helper which i call 'WidgetHelper'. It helps to render some partials automatically when i refer to it. For example
<%= widget('loginbox', :global => true) %>
But it not works correctly. It renders HTML code as I want, but escapes the return value, what is not expected. How can I tell to render (or to something) to not escape the return value for me?
Here is my code:
def widget(widget, options={})
begin
unless options[:fullpath]
render :partial => widget_path(widget, options[:global])
else
render "widgets/#{widget}"
end
rescue ActionView::MissingTemplate
"<!-- widget: #{widget.inspect}, #{options.inspect} -->"
end
end