If I use render :file=>... in a helper function, Rails dies with a
white-screen-of-death (with nothing about it in development.log), but it
works in a controller function, and other render functions (like render
:text) work in the helper function.
# in helper - results in WSOD
module PagesHelper
def body_render(page)
case page.type.name
when ''Markaby Template''
render :file=>page.file, :layout=>false # WSOD
when ''RedCloth Template''
RedCloth.new(page.body).to_html # works, btw
when ''Text''
render :text=>''foo'' # works
end
end
end
# in controller - works
def show
@page = Page.find(params[:id])
render :file=>@page.file
end
# view
body_render(@page.body)
Wrapping the render :file in begin/rescue/end also doesn''t trap
whatever
error is occurring.
Any ideas how to get this to work?
Thanks,
Joe
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---