Closed dcu closed 12 years ago
Could you give me a little more detail on this error. What were you trying to do when the error occurred, and what version of Poirot are you using?
i am hitting something like this as well in Rails 3.0.6
poirot (0.0.3) lib/poirot/view.rb:40:in send' poirot (0.0.3) lib/poirot/view.rb:40:in
assign_variables!'
poirot (0.0.3) lib/poirot/view.rb:7:in initialize' app/views/users/_users_list.html.mustache:1:in
new'
app/views/users/_users_list.html.mustache:1:in _app_views_users__users_list_html_mustache___1993752031_2207653440_2031230' actionpack (3.0.6) lib/action_view/template.rb:135:in
send'
actionpack (3.0.6) lib/action_view/template.rb:135:in render' activesupport (3.0.6) lib/active_support/notifications.rb:54:in
instrument'
actionpack (3.0.6) lib/action_view/template.rb:127:in render' actionpack (3.0.6) lib/action_view/render/partials.rb:333:in
render_partial'
actionpack (3.0.6) lib/action_view/render/partials.rb:262:in render' activesupport (3.0.6) lib/active_support/notifications.rb:52:in
instrument'
activesupport (3.0.6) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (3.0.6) lib/active_support/notifications.rb:52:in
instrument'
actionpack (3.0.6) lib/action_view/render/partials.rb:260:in render' actionpack (3.0.6) lib/action_view/render/partials.rb:378:in
_render_partial'
actionpack (3.0.6) lib/action_view/render/rendering.rb:22:in render' app/views/users/index.html.erb:9:in
_app_views_users_index_html_erb__1515899555_2207670280_0'
actionpack (3.0.6) lib/action_view/template.rb:135:in send' actionpack (3.0.6) lib/action_view/template.rb:135:in
render'
activesupport (3.0.6) lib/active_support/notifications.rb:54:in instrument' actionpack (3.0.6) lib/action_view/template.rb:127:in
render'
actionpack (3.0.6) lib/action_view/render/rendering.rb:59:in `_render_template'
updated to Rails 3.0.10 and I get the same thing...
poirot (0.0.3) lib/poirot/view.rb:40:in send' poirot (0.0.3) lib/poirot/view.rb:40:in
assign_variables!'
poirot (0.0.3) lib/poirot/view.rb:7:in initialize' app/views/users/_users_list.html.mustache:1:in
new'
app/views/users/_users_list.html.mustache:1:in _app_views_users__users_list_html_mustache___1993752031_2165237980_2035870' actionpack (3.0.10) lib/action_view/template.rb:135:in
send'
actionpack (3.0.10) lib/action_view/template.rb:135:in `render'
controller: def index @users = User.order('lower(name)').all end
view: app/views/index.html.erb
app/views/users/_users_list.html.mustache
it works on my repo, try it out
It did work in your example project https://github.com/olivernn/notepad took awhile of digging since both my project and yours had gem 'poirot' in the Gemfile, but my project was bundle installing 0.0.3, while your project was getting 0.0.2. When I changed my project to gem 'poirot', '0.0.2' and bundled installed, then everything worked in my project. So it looks like there is a bug in 0.0.3 of poirot.
I will stay on 0.0.2 for now... to help debug 0.0.3 here are some additional details.
I added debug lines into the view.rb
# get the locals from the view context, is there a better way?
Rails.logger.info "*"*40
Rails.logger.info view_context.inspect
Rails.logger.info view_context.class
locals = view_context.send(:view_renderer).send(:_partial_renderer).instance_variable_get("@locals") || {}
output:
#<#Class:0x10b1fb5b0:0x10b1f9a08 @controller_path="site", @renderer=# <ActionView::Partials::PartialRenderer:0x10b1f2fc8 @collection=nil, @path="check", @template=app/views/site/_check.html.mustache, @block=nil, @locals={:check=>nil}, @view=#<#Class:0x10b1fb5b0:0x10b1f9a08 ...>, @options={:partial=>"check"} ...
#Class:0x10b1fb5b0
Cool thanks for investigating this.
I think there were some quite big changes in the way view renderers work between Rails 3.0 and Rails 3.1. I tried to keep the gem working in both versions, but apparently this has failed.
@dcu is your repo at 0.0.3 or 0.0.2? Does it work in both Rails 3.0 and 3.1?
I'll try and get some time to get a more robust version out there, which will hopefully work in both Rails 3.0 and 3.1.
it works with both rails 3.0 and rails 3.1
@dcu I'd be more than happy to accept a pull request with your changes to get poirot back working in both rails 3.0 and 3.1.
I have released a new version which should work fine in both Rails 3 and Rails 3.1, if there are any issues please let me know.
I am getting this error with rails 3.0.10:
in