Welcome Guest | Login

NoMethodError in Production Log

Hey folks, still trying to get my app to work.

I'm getting this error in my Production Log:

NoMethodError (undefined method `rbController' for JobsController:Class):
   generated/routing/recognition.rb:4:in `recognize_path'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:511:in `recognize!'
   /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in `dispatch'
   /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:in `process_request'
   /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:54:in `process!'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi'
   /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in `process!'
   /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:in `process!'
   dispatch.fcgi:24

2006-12-28 07:23 AM

hmmm - well at some point in your code you are calling something like

link_to('something', :controller => 'jobs', :action => 'rbController')

So Rails is looking for the method (action) called rbController -- post the code in your view/controller and we can help out more.  

2006-12-28 07:40 AM

That's what I thought it meant.  But I've searched through my code and I can't find any instance of "rbController", would it have been left over from the scaffolding stuff?

Here's my jobs_controller.rb

class JobsController < ApplicationController
 def index
   list
   render :action => 'list'
 end

 # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
 verify :method => :post, :only => [ :destroy, :create, :update ],
        :redirect_to => { :action => :list }
       
 def list
   @category = @params['category']
   @jobs = Job.find_all
 end

 def show
   @job = Job.find(params[:id])
 end

 def new
   @job = Job.new
   @categories = Category.find_all
 end

 def create
   @job = Job.new(params[:job])
   if @job.save
     flash[:notice] = 'Job was successfully created.'
     redirect_to :action => 'list'
   else
     render :action => 'new'
   end
 end

 def edit
   @job = Job.find(params[:id])
   @categories = Category.find_all
 end

 def update
   

   @job = Job.find(params[:id])
   if @job.update_attributes(params[:job])
     flash[:notice] = 'Job was successfully updated.'
     redirect_to :action => 'show', :id => @job
   else
     render :action => 'edit'
   end
 end

 def delete
     Job.find(@params['id']).destroy
     flash[:notice] = 'Job was deleted.'
     redirect_to :action => 'list'
 end
end


Here's my list.rhtml in view

<div id="table">
<table border="0">
<tr>
<td width="30%"><h3>Position</h3></td>
<td width="30%"><h3>Employer</h3></td>
<td width="20%"><h3>Category</h3></td>
<td width="10%"><h3>Added</h3></td>
</tr>

<% @jobs.each do |job| %>
 <% if (@category == nil) || (@category == job.category.name)%>
 <tr>
<td>
 <%= link_to job.position,
 :action => "show",
 :id => job.id %>
</td>
<td>
 <%= job.employer%>
</td>
<td>
 <%= link_to job.category.name,
  :action => "list",
  :category => "#{job.category.name}" %>
</td>
<td>
 <%= job.date %>
</td>
 </tr>
<% end %>
<% end %>
</table>
</div>
<br><br>


I should probably mention that I built this app from following this tutorial and making minor changes.

2006-12-28 07:53 AM

when are you seeing this error?  That is, what do you click on or load to produce the error?

2006-12-28 09:05 AM

hey phillyh, i take it your from philly? im right over the bridge near 42. it seems we will be both making applications for the tristate area. =)

2006-12-30 12:38 AM

Thanks for your help William.
I get the error when I go to the default domain address.   http://www.phillyhomeless.com
Although I've found out that I can just type in the director /jobs and it seems to work fine.

This might be better for me anyways because it allows me to use a different index page, but I'm still curious as to the meaning of the error.


Hi mixplate.  I'm new to the NE and honestly I don't know which bridge you're talking about or what "42" means. :D  Although it's nice to know there are some rails folks in the area.  I've found this group http://www.phillyonrails.org and I'm going to try to go to their next meeting and see what it's all about.

2006-12-30 01:11 PM

It could be a problem with your default route maybe?  Yeah I see your index page...:)  Paste in your map.connect '', :controller => "something"  -- or whatever you have...

2006-12-30 01:31 PM

hey phillyh, thanks for the link, i will definitely check it out. im sure meeting more ror developers will speed me up on understanding of web development.

42 it just the name of the highway right off of the ben franklin bridge.

i wonder if there are any web designer groups that meet up because my design skills lack very much. !

2006-12-31 10:46 AM

map.connect '', :controller => 'jobs_controller.rb'

 # Install the default route as the lowest priority.
 map.connect ':controller/:action/:id'

2007-01-30 04:22 PM

I think that is your problem Phillyh. Try your routes.rb with this line

map.connect "", :controller => "jobs", :action => "index"
Of course change the default action to which ever one you want.

2007-01-30 04:29 PM

That's it, works like a charm.

This forum is fantastic.

2007-01-30 04:35 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.