Git Product home page Git Product logo

Comments (9)

olivernn avatar olivernn commented on July 24, 2024

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?

from poirot.

danmayer avatar danmayer commented on July 24, 2024

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:inassign_variables!'
poirot (0.0.3) lib/poirot/view.rb:7:in initialize' app/views/users/_users_list.html.mustache:1:innew'
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:insend'
actionpack (3.0.6) lib/action_view/template.rb:135:in render' activesupport (3.0.6) lib/active_support/notifications.rb:54:ininstrument'
actionpack (3.0.6) lib/action_view/template.rb:127:in render' actionpack (3.0.6) lib/action_view/render/partials.rb:333:inrender_partial'
actionpack (3.0.6) lib/action_view/render/partials.rb:262:in render' activesupport (3.0.6) lib/active_support/notifications.rb:52:ininstrument'
activesupport (3.0.6) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (3.0.6) lib/active_support/notifications.rb:52:ininstrument'
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:inrender'
activesupport (3.0.6) lib/active_support/notifications.rb:54:in instrument' actionpack (3.0.6) lib/action_view/template.rb:127:inrender'
actionpack (3.0.6) lib/action_view/render/rendering.rb:59:in `_render_template'

from poirot.

danmayer avatar danmayer commented on July 24, 2024

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:inassign_variables!'
poirot (0.0.3) lib/poirot/view.rb:7:in initialize' app/views/users/_users_list.html.mustache:1:innew'
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:insend'
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

<%= render :partial => "users_list" %>

app/views/users/_users_list.html.mustache

from poirot.

dcu avatar dcu commented on July 24, 2024

it works on my repo, try it out

from poirot.

danmayer avatar danmayer commented on July 24, 2024

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

from poirot.

olivernn avatar olivernn commented on July 24, 2024

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.

from poirot.

dcu avatar dcu commented on July 24, 2024

it works with both rails 3.0 and rails 3.1

from poirot.

olivernn avatar olivernn commented on July 24, 2024

@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.

from poirot.

olivernn avatar olivernn commented on July 24, 2024

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.

from poirot.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.