If I define a helper method that contains invalid syntax, then rails will silently ignore that helper file. It was kind of frustrating, I was writing a new method, when rails started giving me these errors that my other helper methods didn''t exist, and I wasn''t sure what was going on. Then I fixed the syntax error and all the methods came back. So maybe rails should be updated to display syntax errors in the helper files before showing errors that the other methods in the helper file don''t exist. -- One Guy With A Camera http://rbpark.ath.cx
On Sat, 12 Mar 2005 02:23:27 -0700, Rob Park <rbpark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If I define a helper method that contains invalid syntax, then rails > will silently ignore that helper file. > > It was kind of frustrating, I was writing a new method, when rails > started giving me these errors that my other helper methods didn''t > exist, and I wasn''t sure what was going on. Then I fixed the syntax > error and all the methods came back. > > So maybe rails should be updated to display syntax errors in the > helper files before showing errors that the other methods in the > helper file don''t exist. >Doesn''t the error show up in the logs?
On Sat, 12 Mar 2005 03:19:19 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Doesn''t the error show up in the logs?Actually, no. The only error that shows up in the logs is the same error that was displayed in the browser, namely, "undefined method..." for a method that very clearly is defined. Of course, now that I know "undefined method" means "oh, it''s ignoring my helper file because of a syntax error", it''ll be easier in future. But it was very frustrating figuring that out on my own. The error message for that situation could certainly be more helpful. -- One Guy With A Camera http://rbpark.ath.cx
On Sat, 12 Mar 2005, Rob Park wrote:> On Sat, 12 Mar 2005 03:19:19 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Doesn''t the error show up in the logs? > > Actually, no. The only error that shows up in the logs is the same error > that was displayed in the browser, namely, "undefined method..." for a > method that very clearly is defined. > > Of course, now that I know "undefined method" means "oh, it''s ignoring my > helper file because of a syntax error", it''ll be easier in future. But it > was very frustrating figuring that out on my own. The error message for that > situation could certainly be more helpful.in the end, rails coding is just like other cgi programming: you have all the normal permissions, syntax, security issues to overcome outside of rails. my rule of thumb is alwyas, always, always to make sure the program will run, or at least compile, something like ~ > ruby -c `find . -name ''*.rb''` if you don''t use ''ruby -c'' - i''ts a read headache saver! cheers. -a -- ==============================================================================| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | When you do something, you should burn yourself completely, like a good | bonfire, leaving no trace of yourself. --Shunryu Suzuki ===============================================================================