I totally agree, but the reason I moved my views and added the Admin::
namespace to my extension controller was because radiant didn’t find
them in the appropriate spot in my extensions folder. It threw an
error. Thus it was looking for them in the wrong place. So I moved
them to where it was looking for them just to get my extension to
work. This is the error I get (when I don’t add the Admin namespace
to my extension’s controller):
Processing ApplicationController#index (for 70.190.32.209 at
2007-03-20 00:18:17) [GET]
Session ID: fbe9e7f1f92a5776b70cfcc3a04ad1d1
Parameters: {“action”=>“index”, “controller”=>"/admin/lectures"}
NameError (uninitialized constant Admin::LecturesController):
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:267:in
load_missing_constant' /vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:453:in
const_missing’
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/inflector.rb:251:in
constantize' /vendor/rails/activerecord/lib/../../activesupport/lib/active_support/core_ext/string/inflections.rb:148:in
constantize’
/vendor/rails/actionpack/lib/action_controller/routing.rb:1258:in
recognize' /vendor/rails/railties/lib/dispatcher.rb:40:in
dispatch’
/vendor/rails/railties/lib/fcgi_handler.rb:168:in process_request' /vendor/rails/railties/lib/fcgi_handler.rb:143:in
process_each_request!’
/vendor/rails/railties/lib/fcgi_handler.rb:109:in
with_signal_handler' /vendor/rails/railties/lib/fcgi_handler.rb:142:in
process_each_request!’
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in
each_cgi' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in
each’
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in
each_cgi' /vendor/rails/railties/lib/fcgi_handler.rb:141:in
process_each_request!’
/vendor/rails/railties/lib/fcgi_handler.rb:55:in process!' /vendor/rails/railties/lib/fcgi_handler.rb:25:in
process!’
dispatch.fcgi:24
Now, after adding the Admin namespace to my extension controller and
not coping the views to radiant/app/views/admin directory, I get this
error:
Processing LecturesController#index (for 70.190.32.209 at 2007-03-21
00:37:46) [GET]
Session ID: fbe9e7f1f92a5776b70cfcc3a04ad1d1
Parameters: {“action”=>“index”, “controller”=>"/admin/lectures"}
e[4;36;1mSQL (0.048391)e[0m e[0;1mSELECT count(*) AS count_all
FROM lectures e[0m
e[4;35;1mLecture Load (0.000248)e[0m e[0mSELECT * FROM lectures
ORDER BY date_and_time DESC LIMIT 0, 10e[0m
Rendering layoutfalseactionlist within layouts/application
ActionController::MissingTemplate (Missing template
…/config/…/app/views/admin/lectures/list.rhtml):
/vendor/rails/actionpack/lib/action_controller/base.rb:1205:in
assert_existence_of_template_file' /vendor/rails/actionpack/lib/action_controller/base.rb:804:in
render_file’
/vendor/rails/actionpack/lib/action_controller/base.rb:738:in
render_with_no_layout' /vendor/rails/actionpack/lib/action_controller/base.rb:863:in
render_without_layout’
/vendor/rails/actionpack/lib/action_controller/base.rb:798:in
render_action' /vendor/rails/actionpack/lib/action_controller/base.rb:748:in
render_with_no_layout’
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/deprecation.rb:43:in
silence' /vendor/rails/actionpack/lib/action_controller/base.rb:747:in
render_with_no_layout’
/vendor/rails/actionpack/lib/action_controller/layout.rb:244:in
render_without_benchmark' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
render’
/usr/local/lib/ruby/1.8/benchmark.rb:293:in measure' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
render’
/vendor/extensions/education/app/controllers/lectures_controller.rb:4:in
index' /vendor/rails/actionpack/lib/action_controller/base.rb:1095:in
send’
/vendor/rails/actionpack/lib/action_controller/base.rb:1095:in
perform_action_without_filters' /vendor/rails/actionpack/lib/action_controller/filters.rb:632:in
call_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:634:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
call_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
call' /vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
call_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
call’
/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:638:in
call_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
call' /vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
call_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:619:in
perform_action_without_benchmark' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
perform_action_without_rescue’
/usr/local/lib/ruby/1.8/benchmark.rb:293:in measure' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
perform_action_without_rescue’
/vendor/rails/actionpack/lib/action_controller/rescue.rb:83:in
perform_action' /vendor/rails/actionpack/lib/action_controller/base.rb:430:in
send’
/vendor/rails/actionpack/lib/action_controller/base.rb:430:in
process_without_filters' /vendor/rails/actionpack/lib/action_controller/filters.rb:624:in
process_without_session_management_support’
/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in
process' /vendor/rails/actionpack/lib/action_controller/base.rb:330:in
process’
/vendor/rails/railties/lib/dispatcher.rb:41:in dispatch' /vendor/rails/railties/lib/fcgi_handler.rb:168:in
process_request’
/vendor/rails/railties/lib/fcgi_handler.rb:143:in
process_each_request!' /vendor/rails/railties/lib/fcgi_handler.rb:109:in
with_signal_handler’
/vendor/rails/railties/lib/fcgi_handler.rb:142:in
process_each_request!' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in
each_cgi’
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in
each' /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in
each_cgi’
/vendor/rails/railties/lib/fcgi_handler.rb:141:in
process_each_request!' /vendor/rails/railties/lib/fcgi_handler.rb:55:in
process!’
/vendor/rails/railties/lib/fcgi_handler.rb:25:in `process!’
dispatch.fcgi:24
I don’t have to modify anything locally, so my local environment works
without have to do these extra steps. Thus my suspicion is that due
to the different setups (mongrel vs FastCGI) between my dev
environment (my computer) and my production (hosting) environment
causes radiant to behave differently.
I am a still learning RoR, so I am looking for some advice on how to
troubleshoot this problem. Is the code that tells radiant where to
look dependent on FastCGI and mongrel?
My define_routes look like this in my_extension.rb file
define_routes do |map|
map.connect ‘/admin/education/:action’, :controller =>
‘/admin/lectures’
map.connect ‘/admin/grandrounds/:action’, :controller =>
‘/admin/grandrounds’
end
I very much would like my extension to act like the LDAP extension and
not have to mess with manual moving of my views and adding the
namespace, but I just don’t know what to fix and more specially what
the fix is that would make my radiant work in production and still
continue to work in development.
Jason