Chris Shorrock
2005-Dec-15 20:22 UTC
Error: [Object]Controller: missing default helper path [controller]_helper
Hello, I seem to have run into a problem that I can''t seem to make any headway on. I''ve searched the mailing archives, google''d for the appropriate keywords and have checked up with the folks on IRC but I can''t seem to find a solution. My problem is as such. I have a web application that has various controllers which work fine. I''ve added a new controller for the object Event, which at this point is very simple and reads as: class EventController < ApplicationController layout ''standard'' before_filter :authorize # method handle used for handling adding new events to the system def add @locations = Location.find_roots @arts = Art.find_all @event = Event.new( @params[:event] ) @event.user = @session[:user] if @request.post? and @event.save redirect_to :action=>:view, :id=>@event.id else @event.errors.each_full do |msg| logger.error( "error while saving event: #{msg}") end end end end When I call http://localhost:3000/event/add/ it loads the correct view which has a variety of form elements. When I commit this form I get a blank page, and the output of WEBrick reads: 127.0.0.1 - - [15/Dec/2005:11:57:06 PST] "POST /event/add HTTP/1.1" 500 0 http://localhost:3000/event/add/ -> /event/add The ONLY line which gets appended to the development.log is: EventController: missing default helper path event_helper Does anybody have any ideas what is going on? I''ve restarted the server numerous times and have even (on a tip from the mailling list archive) rebooted. Any help would be welcomed with much praise... Chris
Chris Hall
2005-Dec-15 20:36 UTC
Re: Error: [Object]Controller: missing default helper path [controller]_helper
my first guess is you probably did not use ''script/generate controller event'' to create your controller, as that should have created the app/helpers/event_helper.rb file as well but i could be wrong. On 12/15/05, Chris Shorrock <chris-cpZfIX6dgjo4Q++5jOxPmw@public.gmane.org> wrote:> > Hello, > > I seem to have run into a problem that I can''t seem to make any > headway on. I''ve searched the mailing archives, google''d for the > appropriate keywords and have checked up with the folks on IRC but I > can''t seem to find a solution. > > My problem is as such. I have a web application that has various > controllers which work fine. I''ve added a new controller for the > object Event, which at this point is very simple and reads as: > > class EventController < ApplicationController > layout ''standard'' > > before_filter :authorize > > # method handle used for handling adding new events to the system > def add > @locations = Location.find_roots > @arts = Art.find_all > @event = Event.new( @params[:event] ) > @event.user = @session[:user] > > if @request.post? and @event.save > redirect_to :action=>:view, :id=>@event.id > else > @event.errors.each_full do |msg| > logger.error( "error while saving event: #{msg}") > end > end > end > > end > > When I call http://localhost:3000/event/add/ it loads the correct > view which has a variety of form elements. When I commit this form I > get a blank page, and the output of WEBrick reads: > > 127.0.0.1 - - [15/Dec/2005:11:57:06 PST] "POST /event/add HTTP/1.1" > 500 0 > http://localhost:3000/event/add/ -> /event/add > > The ONLY line which gets appended to the development.log is: > > EventController: missing default helper path event_helper > > Does anybody have any ideas what is going on? I''ve restarted the > server numerous times and have even (on a tip from the mailling list > archive) rebooted. Any help would be welcomed with much praise... > > Chris > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Chris Shorrock
2005-Dec-15 20:49 UTC
Re: Error: [Object]Controller: missing default helper path [controller]_helper
Hmm... good guess - I didn''t think it was required, since my other controllers work without it, and my controller works, just not when I post to the add method.. Anyhow - to be safe - I regenerated the controller from scratch and re-ran it. The problem turns out to be the same as before, only now while I still get a 500 response and a blank page in my browser there is no messages whatsoever added to the development.log... On 15-Dec-05, at 12:36 PM, Chris Hall wrote:> my first guess is you probably did not use ''script/generate > controller event'' to create your controller, as that should have > created the app/helpers/event_helper.rb file as well > > but i could be wrong. > > On 12/15/05, Chris Shorrock <chris-cpZfIX6dgjo4Q++5jOxPmw@public.gmane.org> wrote: > Hello, > > I seem to have run into a problem that I can''t seem to make any > headway on. I''ve searched the mailing archives, google''d for the > appropriate keywords and have checked up with the folks on IRC but I > can''t seem to find a solution. > > My problem is as such. I have a web application that has various > controllers which work fine. I''ve added a new controller for the > object Event, which at this point is very simple and reads as: > > class EventController < ApplicationController > layout ''standard'' > > before_filter :authorize > > # method handle used for handling adding new events to the system > def add > @locations = Location.find_roots > @arts = Art.find_all > @event = Event.new( @params[:event] ) > @event.user = @session[:user] > > if @request.post? and @event.save > redirect_to :action=>:view, :id=>@ event.id > else > @event.errors.each_full do |msg| > logger.error( "error while saving event: #{msg}") > end > end > end > > end > > When I call http://localhost:3000/event/add/ it loads the correct > view which has a variety of form elements. When I commit this form I > get a blank page, and the output of WEBrick reads: > > 127.0.0.1 - - [15/Dec/2005:11:57:06 PST] "POST /event/add HTTP/1.1" > 500 0 > http://localhost:3000/event/add/ -> /event/add > > The ONLY line which gets appended to the development.log is: > > EventController: missing default helper path event_helper > > Does anybody have any ideas what is going on? I''ve restarted the > server numerous times and have even (on a tip from the mailling list > archive) rebooted. Any help would be welcomed with much praise... > > Chris > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails