similar to: Calling a controller action from script/console or runner

Displaying 20 results from an estimated 40000 matches similar to: "Calling a controller action from script/console or runner"

2006 Jun 28
7
caching objects
Hi, i just wanted to say my sorries in advance (sorrie/sorry/sorri)...i have just started learning about the subject of caching, but unfortunately haven''t effictively managed to implement what i had learned. obviously it''s possible to cache a whole page, or action with the caches_page :x or caches_action :y methods, but for some reason it hasn''t really worked with
2007 Jan 22
2
caches_action :index for site root gets propagated to lower levels (how to stop?)
Hello all, I am running a blog system which has its "/" (home page) cached like this: class ApplicationController < ActionController::Base before_filter :index_cache_expirer, :only => [:index] caches_action :index so the site''s top page is caches for 60 seconds in my case (index_cache_expirer is a home-made function to expire) on the site, there is also a
2008 Sep 24
3
caches_page :if not executing (but caches_action :if) does
Hi folks - Seeing a weird problem and would love some help. It''s documented in http://pastie.org/278310 to be more readable. In short, I have a caches_page "action", :if => {stuff} but the :if is never being called - the action is just caching every time. (If I put a debugger call in the :if block, it never stops.) If I replace caches_page with caches_action, the if
2007 Mar 01
1
Problems with RC1 & Rails Controllers
I''m now using the 0.8.0 RC1 gem and have the same version of rspec and rspec_on_rails checked out into my vendor/plugins directory. I''m having a problems with controllers... I''ve generated a controller using the ./script/generate rspec_controller MyController. When I try to run the rake spec:controller task I get the following: euclid% rake spec:controllers (in
2006 Jan 27
0
Calling controller methods from runner scripts?
Is it possible (or even recommended) to call controller methods from runner scripts? It appears functional tests do this. I''ve tried, but always get an ''undefined ApplicationController'' error. thanks csn -- Posted via http://www.ruby-forum.com/.
2007 Dec 05
4
render :update and controller private methods
Probably asked and answered, but... Why are controller private methods inaccessible inside the block passed to render :update ? This does not work: class MyController < ApplicationController def some_action render :update do |page| page.replace_html ''an_element'', some_private_method end end private def some_private_method return
2006 Jan 16
3
routing to controller inside module
Hey, am i to stupid to find the information about how to route to a controller in a module? Maybe module support has gone! The controller is under: app/controllers/admin/my_controller.rb The my_controller.rb file looks like this: module Admin class MyController def index render :text => ''Hello!'' end end end How does a route to all controllers under module
2006 Feb 19
1
script/console & script/runner
Hello, Is it possible to call a method in a controller with script/console or script/runner? -- Jonas Elfstr?m
2006 Aug 11
1
Calling a Controller method from the command line
Hi All, I need to run some reports via cron. I know I can use runner and call a method in a model class. But I''d really like to use templates and IMO this kind of logic belongs in a controller anyways. These are periodic reports so I don''t need nor want to leave a server running all the time, so getting the data via curl/wget isn''t really an option. What I really
2008 Oct 22
3
Rake task vs script/runner
Hello, until now I allways used script/runner for running Rails cron jobs I wonder is there is any benefit (except not having any fake runner model in the models directory) to use a rake task instead in lib/tasks Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2008 Oct 28
1
Script/Runner
I have a production site that has a couple of batch jobs, I have used script/runner and cron to run these jobs. This works ok for jobs that only run once overnight during off peak. I am expiring sessions older than 30 mins every 15 mins using script/runner, but I''m concerned about the hit of script/runner loading up the whole rails environment, specifically since I only have a 256MB
2009 Apr 24
3
Running in non-dev envs. with script/runner shebang setup
All, I have a script that runs script/runner via the shebang mechanism at the top o the file, like so: #!/usr/bin/env ./script/runner This works fine in development, how would I get it to run in non-development environments? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2005 Mar 02
2
form action in mail (actionmailer)
Hi everyone. : ) I meet problem when use form tag in actionmailer. (content-type is text/html, surely) I want to use form action in actionmailer''s view (.rhtml) for some reason. 1. I use start_form_tag helper method as normally, but how I can ? I did <%= start_form_tag :action => "http://myhostname/mycontroller/myaction" %> or <%= start_form_tag :action =>
2007 Apr 20
0
how to call controller from script/runner
I''d like to call a controller method or three from a script invoked via script/runner so that I can manually populate my page cache. How would I go about doing so? - donald --~--~---------~--~----~------------~-------~--~----~ 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
2006 May 29
2
How to use script/runner
I''ve read the wiki and Agile and can''t find the answer. When using script/runner I''ve gotten simple model functions similar to the -help example to run: $script/runner ''puts Vendor.find(1).name3'' where Vendor is a model. However when I try to run a function in a controller it doesn''t work: $script/runner ''puts
2006 Nov 04
8
alternatives to script/runner?
I''ve been using script/runner to add and delete files from the database in response to inotify events. This works in theory, but is too slow to keep up with a large number of events in succession; I''m suspecting that the bottleneck is that script/runner has a huge startup cost. One thing I thought of was to queue inotify events, and call script/runner once a minute to clear the
2006 Jul 26
1
lesson learned: script/runner does not abort on failed require
After a fresh installation of an application, some utility scripts run with script/runner quietly aborted right after their start. No error message whatsoever, just a new shell prompt. The reason was an uninstalled dependecy, but that was difficult to determine because the load failure was not reported: % ruby script/runner ''require "foobarbaz"'' % Why
2006 Apr 10
2
using web service for authenitcation
I am writting a web service for authenitcation of users and was using web_service_scaffold :invoke for testing it out...and was able to consume it using .NET. But my question is, whats the simplest method using which i can use the same web service in the current Web App. I mean, not from an external application or something but from the current web apps itself. I found one method in AWDR, and
2006 May 21
6
Is there a way to call helper methods in a controller?
Hi, Is there a way to call helper methods in a controller? I want to do something like this in my controller Class MyController < Action.... def my_method string = link_to "some_url", :controller => "home", :action => "command" end end link_to is an ActionView helper method and it seems that I couldn''t access the method in the controller
2007 Oct 05
5
DRbConnError when using script/runner
I am running ferret (0.11.4) and acts_as_ferret (stable from svn) in a rails 1.2.3 app in production using the DRb server. I recently upgraded my configuration and the method with which I start and stop the server no longer works: Here is the command I would like to use (and have used in the past) to start the aaf server: $ /Library/WebServer/rails/ccdb/current/script/runner -e production