Forum: Ruby on Rails routes.rb, routing issue, intranet example (o'reilly)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0c981f56531343dfcb2ad6bea95b034a?d=identicon&s=25 dathasem (Guest)
on 2007-02-07 15:36
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 method `resources' 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:in
`load'
  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:in
`initialize_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:in
`run'
  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:in
`configure_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:in
`run'
  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
8da92d4ed91aa12535f6d870fa76b25e?d=identicon&s=25 Aaron (Guest)
on 2007-02-07 18:19
(Received via mailing list)
On Feb 7, 7:36 am, dathasem <rails-mailing-l...@andreas-s.net> 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
This topic is locked and can not be replied to.