Comments (12)
Note that the problem goes away if I either a) use the render partial: "form"
syntax, or b) fully qualify the widget name widget(Views::Foo::Form, bar: bar)
. I'm OK living with that, but maybe some documentation would help?
from fortitude.
Whoops — definitely an oversight. Yeah, the triggering case was referring to an autoloaded widget by partially-qualified module path, and I actually never had a test case that did that. Now I do. 😄
(When you write widget(Form, …
above, inside Views::Foo::Edit
, Rails very first looks for something called Views::Foo::Edit::Form
due to namespacing conventions. My code was hence looking for a file named app/views/foo/edit/form.(rb|html.rb)
by scanning the directory app/views/foo/edit
; it correctly dealt with the case where form.rb
didn't exist, but not where app/views/foo/edit
didn't. Now it does.)
Let me know if this works for you — if so, I'll cut 0.0.7 based on it.
from fortitude.
It works... mostly. The widget
line no longer throws errors. But, if I change and reload the Views::Foo::Edit file too many times, eventually I will get this error:
ActionView::Template::Error (superclass mismatch for class Edit):
1: module Views
2: module Foo
3: class Edit < Views::Base
I have seen the 'superclass mismatch' errors before, so this may be a separate issue.
from fortitude.
Oh, and I've been able to avoid the 'superclass mismatch' problem in the past by adding the following line to the top of every view file:
require_dependency 'views/base'
Just tried it, and it seems to work in this case too.
from fortitude.
Hmmm. I'll take a look and see what I can find — I haven't personally run into this problem, but I'll see if I can reproduce it.
If you find a way to reproduce it even semi-reliably, definitely let me know; I am obviously extremely interested in stamping such things out. :)
from fortitude.
I just pushed a branch, ageweke/classloading_debugging
, that contains a single fix that I think might help — it adds a require_dependency
of the widget file itself into the generated template code. If you continue having issues, you might try this branch and see if it helps at all.
from fortitude.
Hmm, don't see the branch in your repo. Where is it pushed to?
from fortitude.
Oops — sorry about that. Fixed now. :)
from fortitude.
That branch doesn't really change things for me.
I've been able to consistently reproduce the error. Would you prefer that info in a new issue or should I put it here?
from fortitude.
Sorry to hear that! By all means, if you can consistently reproduce it, file a new issue. Your bug report above was excellent in terms of thoroughness — that level of detail should be able to help me figure it out. The output of ruby --version
and rails --version
would be awesome, too.
from fortitude.
Oh, and BTW, sorry for the delay. I'm quite scrupulous about not working on OSS during my employer's time or while on their property, so during daytime business hours (PST), I'm unlikely to respond.
from fortitude.
Totally understand... and you're fixing things pretty fast anyway. Thanks again!
from fortitude.
Related Issues (20)
- Unit testing of widgets without loading entire Rails stack in test environment? HOT 2
- Script to convert to and from HTML/ERb? HOT 3
- :csrf_meta_tags helper unavailable? HOT 1
- Even more forms weirdness, or... HOT 11
- Using #inline_html with a Rails view context HOT 2
- Implicit passing of `needs` variables fails when View class is named the same as the `needs` key HOT 4
- Can't mark HTML attribute values as html_safe HOT 1
- Upgraded to Rails 4.2.5.2 and everything is blowing up HOT 3
- use controller.view_paths to resolve view paths when calculating widget_class_from_file HOT 1
- Status? HOT 8
- alias_method_chain deprecated in Rails 5 HOT 2
- fix Travis build HOT 2
- Release latest code to rubygems HOT 1
- ArgumentError: wrong number of arguments (given 5, expected 4) with ActionView 4.2.6 HOT 2
- Issues when running tests: "uninitialized constant OopRailsServer::RailsServer::Bundler" HOT 1
- Regression: automatic inclusion of Rails helpers breaks implicit route arguments HOT 6
- Fortitude prevents Rails csrf_meta_tags from being rendered in the <head> element HOT 1
- retina_images repo unavailable
- Single arity template handlers are deprecated in Rails 6.0
- Still maintained? 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 fortitude.