beginner question: getting a routing error, but method is defined!

0 views
Skip to first unread message

laredo...@zipmail.com

unread,
Jan 9, 2008, 8:15:24 PM1/9/08
to Ruby on Rails: Talk
Hi,

I'm just starting in Ruby on Rails. I have these files:

/webroot/formprocessor/app/views/formprocessor/showform.rhtml
/webroot/formprocessor/app/views/formprocessor/show_formdata.rhtml
/webroot/formprocessor/app/controllers/formprocessor_controller.rb

Here are the contents of teh formprocessor_controller.rb:

class FormprocessorController < ApplicationController
def showform
end

def show_formdata
@name = params[:name]
@prog_languages = params[:prog_languages] || []
@operating_systems = params[:operating_systems] || []
end
end

But after starting my server (ruby /webroot/formprocessor/script/
server), and visiting http://mydomain:3000/formprocessor/showform, I
get this error:

Routing Error
no route found to match "/formprocessor/showform" with {:method=>:get}

But the showform method and views are defined, at least in my mind
anyway. What am I missing?

Thanks, - Dave

Jeremy Weiskotten

unread,
Jan 9, 2008, 8:21:05 PM1/9/08
to rubyonra...@googlegroups.com
Does your routes file specify the default route?

map.connect ':controller/:action/:id'
--
Posted via http://www.ruby-forum.com/.

Ryan Bigg

unread,
Jan 9, 2008, 8:44:16 PM1/9/08
to rubyonra...@googlegroups.com
Can you show us your routes file?

On Jan 10, 2008 11:45 AM, laredo...@zipmail.com <laredo...@zipmail.com > wrote:

Hi,

I'm just starting in Ruby on Rails.  I have these files:

/webroot/formprocessor/app/views/formprocessor/showform.rhtml
/webroot/formprocessor/app/views/formprocessor/show_formdata.rhtml
/webroot/formprocessor/app/controllers/formprocessor_controller.rb

Here are the contents of teh formprocessor_controller.rb:

class FormprocessorController < ApplicationController
   def showform
   end

   def show_formdata
       @name = params[:name]
       @prog_languages = params[:prog_languages] || []
       @operating_systems = params[:operating_systems] || []
   end
end

But after starting my server (ruby /webroot/formprocessor/script/

get this error:

Routing Error
no route found to match "/formprocessor/showform" with {:method=>:get}

But the showform method and views are defined, at least in my mind
anyway.  What am I missing?

Thanks, - Dave






--
Ryan Bigg
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.
Reply all
Reply to author
Forward
0 new messages