ruby - Rails 3 - request.request_uri in model -
exist way have in own function in model request.request_uri?
now have in model called func.rb this:
class func def self.url_adr request.request_uri end end
but getting error undefined local variable or method `request' func:class
the request object available controllers. suppose pass in argument model if must, e.g.
##### in controller func.url_addr(request) ##### in model def self.url_adr(controller_request) controller_request.request_uri end
however, ian has point, request data not associated models.
Comments
Post a Comment