[Radiant] adding my controller in an extension
Raphael Bauduin
rblists at gmail.com
Fri Apr 6 11:40:40 CDT 2007
> > /usr/lib/ruby/gems/1.8/gems/radiant-0.6.0/vendor/rails/
> > activesupport/lib/active_support/dependencies.rb:266:in
> > `load_missing_constant': uninitialized constant ApplicationController
> > (NameError)
>
> This is a problem that continues to come up. In the latest extension
> generator, as found in mental today, you will see that there is a
> line at the top of the generated extension:
>
> # Uncomment this if you reference any of your controllers in activate
> # require_dependency 'application'
>
> So, that could help.
It helps indeed, but I didn't have this comment in the generated
extension. This is with the 0.6rc2 and the svn checkout I did some
days ago:
$ ./script/generate extension test
...
$ cat vendor/extensions/test/test_extension.rb
class TestExtension < Radiant::Extension
version "1.0"
description "Describe your extension here"
url "http://yourwebsite.com/test"
# define_routes do |map|
# map.connect 'admin/test/:action', :controller => 'admin/test'
# end
def activate
# admin.tabs.add "Test", "/admin/test", :after => "Layouts",
:visibility => [:all]
end
def deactivate
# admin.tabs.remove "Test"
end
end
When require the application dependency, the route is followed, but it
requires me to log into radiant. Can I also develop an extension that
is available without the need to log into radiant? I simply want to
add a controller that doesn't need an admin part. What if eg I want to
let people leave their email to I can contact them later on? I though
I'd do that with a controller to which the form is submitted, but then
this controller has to be available without logging into radiant. Or
shold I go in the direction of a plugin/engine?
Thanks for your help
Raph
--
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org
More information about the Radiant
mailing list