Routes.rb, routing issue, intranet example (o'reilly)


#1

Hey folks,

I’m using Windows XP, InstantRails 1.4, Rails 1.1.6, RadRails and
Mongrel.

Everything is set up fine and works (at least for my usual RoR-stuff),
but trying to run the example “Intranet” from the book “Ajax on Rails” -
O’Reilly (Linkt to book:
http://www.oreilly.com/catalog/9780596527440/index.html, Example as
.zip-file: http://examples.oreilly.com/9780596527440/) - i get a
mongrel-error concerning the routes.rb file:
Running Mongrel server in development mode at 0.0.0.0:3002
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:617:in
method_missing': undefined methodresources’ for
#ActionController::Routing::RouteSet:0x3388018 (NoMethodError)
from ./config/…/config/routes.rb:4
from
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:591:in
draw' from ./config/../config/routes.rb:1 from D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:inload’
from
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:574:in
reload' from D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/initializer.rb:239:ininitialize_routing’
from
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/initializer.rb:105:in
process' from D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/initializer.rb:42:inrun’
from ./config/environment.rb:5
from
D:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' from D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.11-mswin32/bin/mongrel_rails:78:inconfigure_rails’
from
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.11-mswin32/bin/mongrel_rails:143:in
run' from D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.11-mswin32/lib/mongrel/command.rb:163:inrun’
from
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.11-mswin32/bin/mongrel_rails:228
from D:\InstantRails\ruby\bin\mongrel_rails:18
from -e:3

The /config/routes.rb:
ActionController::Routing::Routes.draw do |map|

A resource for each post type

map.resources :messages, :plans, :documents, :projects, :contacts,
:member => { :download => :get }

A comments resource under every post type; e.g., /messages/comments

and /documents/comments
map.resources :comments, :path_prefix => “/:post_type/:post_id”

User and session resources

map.resources :sessions
map.resources :users, :collection => { :statuses => :get }, :member =>
{ :status => :any }

Home and default routes

map.home ‘’, :controller => ‘messages’, :action => ‘home’
map.connect ‘:controller/:action/:id’

end


To me this seems like some issue of using the REST-ful-Link-engine
properly, but unfortunately I’m not yet firm with that concept and hope,
somebody has already fixed this issue or knows a workaround to get the
“intranet” going.

Thanks a lot !
taz


#2

On Feb 7, 7:36 am, dathasem removed_email_address@domain.invalid wrote:

Hey folks,

I’m using Windows XP, InstantRails 1.4, Rails 1.1.6, RadRails and
Mongrel.

You’ll need to go up to Rails 1.2 to run this code. The resources
method was introduced in 1.2.

Aaron