I''ve got a couple of helper functions in my application_helper file that I would like to run from the console (for debugging). What is the correct way to invoke a helper from the console? _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
I''ve got a similar question - I want to run a method defined in ApplicationHelper on the console, but using helper.method() doesn''t work. Should it? Thanks, Simon On 24 May 2006 17:07:56 -0000, Kevin Olbrich <devlists-rubyonrails@devlists.com> wrote:> I''ve got a couple of helper functions in my application_helper file that > I would like to run from the console (for debugging). > > What is the correct way to invoke a helper from the console? > > _Kevin > -- > Posted with http://DevLists.com. Sign up and save your mailbox. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
load ''application_helper.rb'' and then just call the functions in the module. If you make changes to the file, just retype the line. Cheers Nic -- Posted via http://www.ruby-forum.com/.
normally, you cannot run helpers or controllers through rails console; however, you can add this by editing the console script and added the following line: require File.dirname(__FILE__) + "/../config/environment.rb" after the line that requires boot.rb I found this out from http://rails.techno-weenie.net/question/2006/7/19/importing-local-files-through-file_column-w-backgroundrb The link is about backgroundrb, but the premise is the same. Jason Simon King wrote:> I''ve got a similar question - I want to run a method defined in > ApplicationHelper on the console, but using helper.method() doesn''t > work. Should it? > > Thanks, > Simon > > On 24 May 2006 17:07:56 -0000, Kevin Olbrich > <devlists-rubyonrails@devlists.com> wrote: >> I''ve got a couple of helper functions in my application_helper file that >> I would like to run from the console (for debugging). >> >> What is the correct way to invoke a helper from the console? >> >> _Kevin