Does engines introduce any routing constraints

Hi all,

Does anyone know whether engines introduces any routing (i.e.
routes.rbversus how url_for/link_for work)?

I’m having problems with url generation that seem to revolve around
controllers that are a subdirectory down, that is have a “/” in the
description such as “active_rbac/login”. I’m trying to test to see if
it
could be due to the fact that the controller is within an engine plugin.

For example the forward slash in the controller link_to below doesn’t
work
(although for normal rails controllers you can do this).

        <%= link_to "Login",  { :controller => '/active_rbac/login',

:action => ‘login’ } %>

In this case I get:

ActionController::RoutingError in Splash#index

Showing app/views/layouts/site_layout.rhtml where line #21 raised:

No url can be generated for the hash {:action=>“login”,
:controller=>“active_rbac/login”}

Extracted source (around line #21):

18:
19:
20: <%= link_to “Register”, {:controller =>
‘active_rbac/registration’ } %> |
21: <%= link_to “Login”, { :controller => ‘/active_rbac/login’,
:action => ‘login’ } %>
22: <% else %>
23: <%= link_to “Logout”, { :controller => ‘active_rbac/login’,
:action => ‘logout’ } %>
24: <% end %>

Trace of template inclusion: /app/views/layouts/splash_layout.rhtml

RAILS_ROOT: ./script/…/config/…
Application Trace http://localhost:3000/en# | Framework
Tracehttp://localhost:3000/en#| Full
Trace http://localhost:3000/en#

generated_code/routing/generation_for_controller_active_rbac/login.rb:58:in
generate_path_for_active_rbac__login' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:473:ingenerate_path’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:469:in
generate' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/url_rewriter.rb:44:inrewrite_path’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/url_rewriter.rb:11:in
rewrite' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:488:inurl_for’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/helpers/url_helper.rb:27:in
url_for' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/helpers/url_helper.rb:59:inlink_to’
#{RAILS_ROOT}/app/views/layouts/site_layout.rhtml:21:in
_run_rhtml_layouts_site_layout' #{RAILS_ROOT}/config/nested_layout.rb:7:ininside_layout’
#{RAILS_ROOT}/app/views/layouts/splash_layout.rhtml:9:in
`_run_rhtml_layouts_splash_layout’
-e:4

generated_code/routing/generation_for_controller_active_rbac/login.rb:58:in
generate_path_for_active_rbac__login' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:473:ingenerate_path’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:469:in
generate' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/url_rewriter.rb:44:inrewrite_path’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/url_rewriter.rb:11:in
rewrite' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:488:inurl_for’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/helpers/url_helper.rb:27:in
url_for' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/helpers/url_helper.rb:59:inlink_to’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:316:in
compile_and_render_template' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:292:inrender_template’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:251:in
render_file' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:316:incompile_and_render_template’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:292:in
render_template' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:251:inrender_file’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/layout.rb:251:in
render_without_benchmark' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:inrender’
C:/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:in measure' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:inrender’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:942:in
perform_action_without_filters' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:inperform_action_without_benchmark’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' C:/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:inmeasure’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:inperform_action’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in
process_without_filters' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:inprocess_without_session_management_support’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in
process' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:indispatch’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:115:in
handle_dispatch' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:81:inservice’
C:/InstantRails/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in service' C:/InstantRails/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:inrun’
C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:173:in
start_thread' C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:162:instart_thread’
C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:95:in start' C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:92:instart’
C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:23:in start' C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:82:instart’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:67:in
dispatch' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/servers/webrick.rb:59 C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
require' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/server.rb:30 C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require’
script/server:3

generated_code/routing/generation_for_controller_active_rbac/login.rb:58:in
generate_path_for_active_rbac__login' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:473:ingenerate_path’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:469:in
generate' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/url_rewriter.rb:44:inrewrite_path’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/url_rewriter.rb:11:in
rewrite' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:488:inurl_for’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/helpers/url_helper.rb:27:in
url_for' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/helpers/url_helper.rb:59:inlink_to’
#{RAILS_ROOT}/app/views/layouts/site_layout.rhtml:21:in
_run_rhtml_layouts_site_layout' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:316:incompile_and_render_template’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:292:in
render_template' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:251:inrender_file’
#{RAILS_ROOT}/config/nested_layout.rb:7:in inside_layout' #{RAILS_ROOT}/app/views/layouts/splash_layout.rhtml:9:in_run_rhtml_layouts_splash_layout’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:316:in
compile_and_render_template' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:292:inrender_template’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/base.rb:251:in
render_file' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/layout.rb:251:inrender_without_benchmark’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in
render' C:/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:inmeasure’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in
render' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:942:inperform_action_without_filters’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:in
perform_action_without_benchmark' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
C:/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:in measure' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:inperform_action_without_rescue’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in
perform_action' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:inprocess_without_filters’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in
process_without_session_management_support' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:inprocess’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in
dispatch' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:115:inhandle_dispatch’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:81:in
service' C:/InstantRails/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
C:/InstantRails/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in run' C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:162:in
start_thread' C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:95:instart’
C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:92:in start' C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:23:instart’
C:/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:82:in start' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:67:indispatch’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/servers/webrick.rb:59
C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:inrequire’
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/server.rb:30
C:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:inrequire’
script/server:3
-e:4

Request

Parameters: {“locale”=>“en”}

Show session dump http://localhost:3000/en#


:locale: en
flash: !map:ActionController::Flash::FlashHash {}

Response Headers: {“Status”=>“200 OK”, “cookie”=>[],
“Cache-Control”=>“no-cache”}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs