i'm making ruby on rails gem , need access variables cookie or query parameters. how inside gem?
module mymodule def self.my_method # need access cookies, query params, etc end end so controller or view, can call
mymodule.my_method and it'll have access needs.
you need pass in want. whether want pass in each individually or pass in request object , pull out want depends on how/where you'll use gem. lean towards passing in each individually in defined format there aren't surprises b/n rails servers , request object looks like.
Comments
Post a Comment