ruby on rails - Sharing a variable between multiple custom pages in ActiveAdmin -


i working on app consumes web services in json , displays results on custom page. currently, creating http client object in register_page block of custom page. since i'll have multiple custom pages, want re-use http client object across them. new rails , active-admin. pointers on correct way of doing great.

you can by

  session[:variable_to_share] = "some value" 

or

  @@variable_to_share = "some value" 

using session instead of global variable actual better way, using global variable consumes memory expensive.


Comments