Displaying 3 results from an estimated 3 matches for "partial_renderer".
2013 Mar 24
5
Rails 4.0 has_many_through and fields_for
...ck (4.0.0.beta1) lib/action_view/template.rb:143:in `block in render''
activesupport (4.0.0.beta1) lib/active_support/notifications.rb:160:in `instrument''
actionpack (4.0.0.beta1) lib/action_view/template.rb:141:in `render''
actionpack (4.0.0.beta1) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial''
actionpack (4.0.0.beta1) lib/action_view/renderer/partial_renderer.rb:279:in `block in render''
actionpack (4.0.0.beta1) lib/action_view/renderer/abstract_renderer.rb:23:in `block in instrument''
activesupport (4.0.0.beta1) lib/active_support/noti...
2011 Apr 06
1
Time to fix PartialRenderer#partial_path
...ause all of your controllers for an engine will be nested
and it makes doing <%= render @thing %> in your code (and anybody
else''s) extremely tedious and impossible without specifying
the :partial to use.
https://github.com/rails/rails/blob/master/actionpack/lib/action_view/renderer/partial_renderer.rb#L150-159
Normally this function grabs the partial to use with
model_name.partial_path which is great for default views (things/
_thing.html.erb) but as soon as you call it from a controller that is
nested it ends up giving you a path like controller_namespace/things/
_thing.html.erb. I can see t...
2012 Jul 26
2
Using the :layout option when calling render @variable
...layout option when calling render @variable (where
@variable is some ActiveRecord class instance with a corresponding
variables/_variable.html.erb partial view), but as far as I know, Rails
doesn''t support this.
Here''s a quick patch that allows to use the :layout function:
In partial_renderer.rb, add the following elsif block:
if !block && (layout = @options[:layout])
layout = find_template(layout)
elsif !block && (layout = @locals[:layout])
layout = find_template(layout)
end
I attached a patch so you don''t have to paste the tw...