Closed edelmasure closed 14 years ago
Looks like you're trying to define a root
route.
map.filter 'locale'
map.root :controller => :homepage, :action => :show
Try that instead and see if your error goes away.
Yups, I realize there has been a truncation while copy / pasting my route.rb head of code. Here is the real one, having the same effect, and the error message well targets the line number 2. Sounds like filter route is interpreted as a named route, and expected to have a :controller association ?! Could I miss some configuration that affects the regognition of the routing-filter library ? I just installed the gem, and wrote the map.filter directive in route.rb, as explained by the authors... (I'm working with NetBeans 6.8).
Regards,
Ed. ActionController::Routing::Routes.draw do |map| map.filter "locale"
Arf', be sure there are new lines between each route definition :-), I can't make that #$@! copy-paste keep my code format...
...and removing map.filter produces no error... but I can't benefit the path prefix managing convenience.
You need to require the gem as well as install it in your Gemfile
if you're using Bundler or config/environment.rb
if not.
If you don't know how to add a gem dependency to your Rails app there are instructions on http://ryandaigle.com/articles/2008/4/1/what-s-new-in-edge-rails-gem-dependencies.
And if you want to insert a code block use four spaces before a line like this…
Ruby.is_much_better_than?(Java)
DHH.translate(MIT_LICENSE)
Thank you ;-) I was quite convinced I should declare something somewhere... but coming from J2EE RoR seams so magically human-friendly... I still have difficulst to discern dreams and reality ! Anyway, thank you for helping me in my first steps in RoR world ,-) !
Best Regards,
Ed.
just 'forgot to close...
Hi, as a fresh newbie with RoR, I guess I'm missing some trivial step. Anyway, I'm using jRuby 1.4 on Rails 2.3.4, and after installing routing-filter gem that is well sitting in the built-in jRuby directory, I got that error message while launching my app: => Booting WEBrick => Rails 2.3.4 application starting on http://0.0.0.0:3000 JRuby limited openssl loaded. gem install jruby-openssl for full support. http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL /home/edel/.netbeans/6.8/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/builder.rb:175:in
build': Illegal route: the :controller must be specified! (ArgumentError) from /home/edel/.netbeans/6.8/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:309:in
add_route' from /home/edel/.netbeans/6.8/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:317:inadd_named_route' from /home/edel/.netbeans/6.8/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:57:in
method_missing' from /home/edel/Development/NetBeansProjects/biowizard/config/routes.rb:2 from /home/edel/.netbeans/6.8/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:226:indraw' from /home/edel/Development/NetBeansProjects/biowizard/config/routes.rb:1 from /home/edel/Development/NetBeansProjects/biowizard/config/routes.rb:145:in
load' from /home/edel/.netbeans/6.8/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:inload_with_new_constant_marking' ... 16 levels... from /home/edel/.netbeans/6.8/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:31:in
require' from /home/edel/.netbeans/6.8/jruby-1.4.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3My route.rb:
ActionController::Routing::Routes.draw do |map| map.filter "locale" map.connect "", :controller => "homepage", :action => "show" ...
Any idea about what I'm missing ?
Best regards,
Ed.