Jody Leavell
2005-Jan-28 20:35 UTC
Re: error in Index action while following Todo, tutorial
Here is the code I typed in app/controllers/todo_controller.rb ---------------------------------------------- class TodoController < ApplicationController model :todo def index render_text("This is the index") end ---------------------------------------------- And for the next response in this thread line 8 did have a return(linefeed) in it, but I have removed that and still get the error. Thanks for alluding to meaning of the rb:8 as I was clueless about that. ps: in a perhaps unrelated event I have seen where my OS-X Mysql setup is so non-standard that I am going to have to scrap it and start over. t''anks
Dale K. Hawkins
2005-Jan-28 20:43 UTC
Re: error in Index action while following Todo, tutorial
Do you have an ''end'' for your class class TodoContoller < ApplicationController model :todo def index ... end end ^^^^ If this was the problem, might I suggest a programming editor as they are useful for pointing out this sort of problem. On Fri, 28 Jan 2005 14:35:34 -0600, Jody Leavell <jody-g56GQNWZX5KsTnJN9+BGXg@public.gmane.org> wrote:> Here is the code I typed in app/controllers/todo_controller.rb > > ---------------------------------------------- > class TodoController < ApplicationController > > model :todo > > def index > render_text("This is the index") > > end > ---------------------------------------------- > > And for the next response in this thread line 8 did have a > return(linefeed) in it, but I have removed that and still get the error. > Thanks for alluding to meaning of the rb:8 as I was clueless about that. > > ps: in a perhaps unrelated event I have seen where my OS-X Mysql setup > is so non-standard that I am going to have to scrap it and start over. > > t''anks > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- This is my sig. Isn''t it cool....
Joe Van Dyk
2005-Jan-28 20:48 UTC
Re: error in Index action while following Todo, tutorial
On Fri, 28 Jan 2005 14:35:34 -0600, Jody Leavell <jody-g56GQNWZX5KsTnJN9+BGXg@public.gmane.org> wrote:> Here is the code I typed in app/controllers/todo_controller.rb > > ---------------------------------------------- > class TodoController < ApplicationController > > model :todo > > def index > render_text("This is the index") > > end > ---------------------------------------------- > > And for the next response in this thread line 8 did have a > return(linefeed) in it, but I have removed that and still get the error. > Thanks for alluding to meaning of the rb:8 as I was clueless about that. > > ps: in a perhaps unrelated event I have seen where my OS-X Mysql setup > is so non-standard that I am going to have to scrap it and start over. >Functions need a ''end statement'' too. Or, if you look at it differently, classes need an ''end'' statement too. In any event, you are missing an ''end'' statement.
On January 28, 2005 1:35 pm, Jody Leavell wrote:> Here is the code I typed in app/controllers/todo_controller.rb > > ---------------------------------------------- > class TodoController < ApplicationController > > model :todo > > def index > render_text("This is the index") > > end > ---------------------------------------------- > > > And for the next response in this thread line 8 did have a > return(linefeed) in it, but I have removed that and still get the error. > Thanks for alluding to meaning of the rb:8 as I was clueless about that. > > ps: in a perhaps unrelated event I have seen where my OS-X Mysql setup > is so non-standard that I am going to have to scrap it and start over. > > t''anksMake sure you have: class TodoController < ApplicationController def index ... end end Note the ''end'' closing ''def index'', as well as the ''end'' closing the ''class''. Hope this works for you. James
As promised: Doh! it works perfectly now. Thanks for being gentle guys. That should have been more obvious to me. Why does the "model :todo" not require an end? Is it akin to a declaration? My generic coding skills are a bit rusty at the moment. I do have the Ruby docs introducing the syntax so I promise to read them this weekend. ps: for the tutorial I just used vi to open the files for editing quickly. I think there is a way to add syntax highlighting for Ruby. But feel free to mention any editors you like...as long as it does not start any flame wars. ;) -- Best Regards, Jody Leavell
Michael Koziarski
2005-Jan-28 22:46 UTC
Re: error in Index action while following Todo, tutorial
On Fri, 28 Jan 2005 16:05:36 -0600, Jody Leavell <jody.leavell-GISIphQPqQyKDjD76uxLDg@public.gmane.org> wrote:> As promised: Doh! it works perfectly now. > > Thanks for being gentle guys. That should have been more obvious to me. > Why does the "model :todo" not require an end? Is it akin to a > declaration?model is class method defined in ActiveRecord::Base, you''re not defining a new method, just calling a function. model :todo is the same as model(:todo)> My generic coding skills are a bit rusty at the moment. I > do have the Ruby docs introducing the syntax so I promise to read them > this weekend. > > ps: for the tutorial I just used vi to open the files for editing > quickly. I think there is a way to add syntax highlighting for Ruby. But > feel free to mention any editors you like...as long as it does not start > any flame wars. ;)Normally I''d suggest emacs as it *is* the one true editor, but ruby-mode.el is kinda lame. I''ve been using TextMate on my Powerbook, it has excellent rails support.> -- > Best Regards, > > > Jody Leavell > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers Koz
Michael Koziarski wrote:> > On Fri, 28 Jan 2005 16:05:36 -0600, Jody Leavell > > > > ps: for the tutorial I just used vi to open the files for editing > > quickly. I think there is a way to add syntax highlighting for Ruby. But > > feel free to mention any editors you like...as long as it does not start > > any flame wars. ;) > > Normally I''d suggest emacs as it *is* the one true editor, but > ruby-mode.el is kinda lame. I''ve been using TextMate on my Powerbook, > it has excellent rails support.FreeRIDE runs on Linux and Windows and has syntax highlighting and source code navigation by module/class/method: http://freeride.rubyforge.org Curt
Josef Pospíšil
2005-Jan-29 10:17 UTC
Re: error in Index action while following Todo, tutorial
Hello, I started to use vim in screen in terminal on my powerbook, and I''m pretty happy with this configuration. Especialy cause I can get same services and environment on production server. And as I read in some guy''s sig: VI VI VI is the editor of the beast! (I know vim is ten thousand times better than vi, but poetry doesn''t care :-) For ruby I realy recommend buying Programing Ruby, II. edition. I''ve just got my own yesterday, and I''m AMAZED as man can be by anything, but woman. It''s not only guide for ruby, but for life too :-) pepe ps: sorry, I just woke up to wonderful morning. On 28.1.2005, at 23:05, Jody Leavell wrote:> As promised: Doh! it works perfectly now. > > Thanks for being gentle guys. That should have been more obvious to > me. Why does the "model :todo" not require an end? Is it akin to a > declaration? My generic coding skills are a bit rusty at the moment. I > do have the Ruby docs introducing the syntax so I promise to read them > this weekend. > > ps: for the tutorial I just used vi to open the files for editing > quickly. I think there is a way to add syntax highlighting for Ruby. > But feel free to mention any editors you like...as long as it does not > start any flame wars. ;) > > > -- > Best Regards, > > > Jody Leavell > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >