Displaying 3 results from an estimated 3 matches for "lookup_context".
2010 Jul 04
2
Rendering a different format in the implementation of a renderer
...r to convert it to PDF.
As I can see no other clean way, I wish ActionView::LookupContext had a
method #with_format(format) { ... } for overriding the format for the
duration of the block. Such a renderer could then look like this
ActionController.add_renderer(:xyz) do |template, options|
lookup_context.with_format(:html) do
html = render(template, options)
convert_html_to_xyz(html)
end
end
Or, even easier, :format could be an option to #render.
Michael
--
Michael Schuerig
mailto:michael@schuerig.de
http://www.schuerig.de/michael/
--
You received this message because you a...
2012 Sep 18
4
multiple modules defining same method included into a class
...that is the namesapce that Base is defined in???
Well, ActionController module does define a module named Rendering:
module ActionController
module Rendering
def render(*args)
raise ::AbstractController::DoubleRenderError if response_body
super
self.content_type ||= Mime[lookup_context.rendered_format].to_s
response_body
end
So now the method render(*args) is included in the Base class as an
instance method. So when we call, for example, (hypothetically)
ActionView::Base.new.render :action => "my_action", :layout => false,
ActionView::Base is instantia...
2012 Nov 26
5
Missing template pages/layout only occasionally
...ller"=>"pages",
"page"=>"strategicrelationshipacademy", "action"=>"show"}
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9.rc5/lib/action_view/paths.rb:15:in
`find''
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9.rc5/lib/action_view/lookup_context.rb:81:in
`find_template''
...
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.9.rc5/lib/action_controller/metal/instrumentation.rb:39:in
`render_without_wicked_pdf''
/var/www/procyon-live/vendor/plugins/wicked_pdf/lib/pdf_helper.rb:19:in
`render''
/var/www/procyon-live/app/contro...