I''m running into some very strange behavior when I try to add a view to
my
component. I''m writing a quick-n-dirty wiki component (i.e.
"components/wiki"), which works fine if my controller uses
render_text() to
test. When I take that call out, I can see it trying to use the view template.
That is ...
# page_controller.rb
class Wiki::PageController < ActionController::Base
uses_component_template_root
def list
@pages = Wiki::Page.find_all
end
...
end
... produces ...
Missing template .../components//wiki/page/list.rhtml
However, as soon as I create my view directory ("page"), even before I
add the
template, all of a sudden my model disappears, and I get:
NoMethodError in Wiki/page#list
undefined method `find_all'' for
Controllers::Wiki::Page:Dependencies::LoadingModule
/home/steve/src/sloanweb/components/wiki/page_controller.rb:9:in
`list''
What''s going on? If I remove the directory, it goes back to
complaining about
the missing template. But with the directory, I can''t get it to
recognize
the model file. The only work-around I can find is to put the model
definition in the controller file.
This is under 0.10.0, BTW.
-- Steve