Forum: Ruby on Rails How to run controller methods using rails runner ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
576908ab294e24dadb3303a6667b8776?d=identicon&s=25 fahim patel (fahim_patel)
on 2012-11-01 07:05
(Received via mailing list)
Hi all,

I have run my controller methods from console, but now i learn about
rails
runner .

i execute model method successful , but i wish to run my controller
method
using rails runner.

Q  Is this possible to run controller method from rails runner ?

Thanks

Regards
Fahim Babar Patel
576908ab294e24dadb3303a6667b8776?d=identicon&s=25 fahim patel (fahim_patel)
on 2012-11-02 07:37
(Received via mailing list)
Q  Is this possible to run controller method from rails runner ?
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2012-11-02 09:08
(Received via mailing list)
On 1 November 2012 06:04, Fahim Patel <pafahim@gmail.com> wrote:
>
> Hi all,
>
> I have run my controller methods from console, but now i learn about rails
> runner .
>
> i execute model method successful , but i wish to run my controller method
> using rails runner.
>
> Q  Is this possible to run controller method from rails runner ?

I don't believe this is possible, and don't see any reason to want to
do it.  If you have methods there that you want to call from a runner
the methods should probably either be in the models or in separate
modules.  Extract those methods from the controller and then you can
call them either from the controller or from the runner.

Colin
576908ab294e24dadb3303a6667b8776?d=identicon&s=25 fahim patel (fahim_patel)
on 2012-11-02 10:03
(Received via mailing list)
Thanks for reply.

Regards
Fahim Babar Patel
This topic is locked and can not be replied to.