Gopi Raju
Gopi Raju

Reputation: 239

How can i get Request Referer in rails controller

def total
   puts requeset.referrer
   transactions = UTransaction.all
   render json: amount(transactions)
end

i got following error in console

Completed 500 Internal Server Error in 38ms

NameError (undefined local variable or method `requeset' for #<Api::V1::Admin::UTransactionsController:0x007f98d49539d0>)

Upvotes: 3

Views: 4235

Answers (1)

messanjah
messanjah

Reputation: 9278

You have the right method, referrer, but you need to call it on the request object.

puts requeset.referrer

should be

puts request.referrer

Upvotes: 7

Related Questions