Comments (9)
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.
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'
from poirot.
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
from poirot.
it works on my repo, try it out
from poirot.
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.
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.
it works with both rails 3.0 and rails 3.1
from poirot.
@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.
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)
- Support partial `:locals` HOT 4
- segmentation fault when rendering a partial HOT 2
- make "params" available to Poirot::View subclasses HOT 2
- Poirot::View method_missing glitch
- poirot.js not loaded in Rails 3.1.1 ruby 1.8.7 HOT 3
- Is possible to use poirot with handlebars? HOT 5
- Use erb or haml in stache templates HOT 3
- New version of mustache.js HOT 1
- poirot not defined? HOT 1
- Accessing View Class Methods via poirot JS HOT 3
- Support partials HOT 4
- View class can't handle nested attributes HOT 2
- Poirot With Cells HOT 1
- Problem with parameterize in cucumber/selenium HOT 1
- Poirot::View does not support Rails' render
- Work with ActionMailer
- Rails 4? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poirot.