-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
render widget: Views::Hello does not work as expected #14
Comments
Using |
OK, I'm looking at this right now. Some of this stuff is just me not knowing about |
As a side note, I don't think the |
|
If you're planning on keeping erector/fortitude at same time support you can use or modify this. module Erector
module Rails
class << self
def render_with_fortitude(widget, view, local_assigns = {}, is_partial = false, options = {})
if widget.is_a?(Class) && widget < ::Fortitude::Widget
widget = widget.new widget.extract_needed_assigns_from(view.assigns)
end
if widget.is_a? ::Fortitude::Widget
context = ::Fortitude::RenderingContext.new helpers_object: view
widget.render_to(context)
return context.output_buffer_holder.output_buffer.to_s
end
render_without_fortitude(widget, view, local_assigns, is_partial, options)
end
alias_method_chain :render, :fortitude
end
end
end |
OK, just added a whole bunch of specs to the branch |
(I have to take off for a few hours shortly, so the fixes will come later this evening, just as a heads-up.) |
OK, Assuming Travis is happy, I plan to cut 0.0.9 tomorrow with all these fixes. |
delegate_object
you use for therendering_context
is a controller instance instead of theview_context
, so view helpers are not available (and other weird stuff happens):widget
option, Erector tries to render the Fortitude widget somewhere deep withinrender_without_fortitude
view_context.assigns
for needs by default):text
option correctly, but my layout still renders empty. (I noticed if I disabled the layout then the content would come through)Lastly, I'm curious why you chose to do it the way you did, Erector does the following to register a
:widget
renderer:The text was updated successfully, but these errors were encountered: