I use rails-3.0.0.beta3 and ruby-1.9.2-preview3. I have defined some new methods in the application_controller.rb, and need to test them in the consle. If I changed some codes in the application_controller.rb. I should always restart the console. I have tried to use ''reload!'' command, just dosen''t work. And then I use "require ''applicatioin.rb''", still dosen''t work. Help! :( -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Well Application Controller is a class, so I think you would want to do require "ApplicationController" If that does not work you can always just paste the methods in and call them. Kind of hacky but it works. On Jul 25, 7:44 pm, Charles Wang <crop...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I use rails-3.0.0.beta3 and ruby-1.9.2-preview3. > > I have defined some new methods in the application_controller.rb, and > need to test them in the consle. > > If I changed some codes in the application_controller.rb. > I should always restart the console. > > I have tried to use ''reload!'' command, just dosen''t work. > > And then I use "require ''applicatioin.rb''", > still dosen''t work. > > Help! :(-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Jul-27 17:51 UTC
Re: How can I force require a file in the console?
Charles Wang wrote:> I use rails-3.0.0.beta3 and ruby-1.9.2-preview3. > > I have defined some new methods in the application_controller.rb, and > need to test them in the consle. > > If I changed some codes in the application_controller.rb. > I should always restart the console. > > I have tried to use ''reload!'' command, just dosen''t work. > > And then I use "require ''applicatioin.rb''", > still dosen''t work. > > Help! :(How are you trying to run your controller methods in the console? What''s the exact syntax you''re using? Normally, you can''t do this easily... Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.