Home How can I run a Rails controller action manually ("offline")?
Reply: 0

How can I run a Rails controller action manually ("offline")?

user807 Published in August 15, 2018, 8:44 pm

I need a way to run controller actions manually "offline" and store the result output.

Looking into controller initialization, it seems nothing interesting happens there.

Looking into send_action, it seems by the time this is called, the controller instance already knows much about the action! (e.g. @_action_name, @_env, etv... are already set!).

I need to understand where that happened so I can do in manually to a controller instance. I have never quite figured out how to navigate code as dynamic as Rails, and cannot seem to find out where this set up occurs. I've used caller in a few places to understand how actions get called but haven't found the code I'm looking for.

Any help is appreciated.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303259 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO