2011-07-20 33 views

Trả lời

2

yêu cầu đối tượng. bạn có thể sử dụng request.fullpath

tham khảo API là here

+0

'request.fullpath' sẽ trả về '/ stuff' trong trường hợp này. – bhaity

0

Cách tốt nhất tôi tìm thấy:

url_for(:only_path => false) 
1

Hãy thử thêm dòng sau vào tập tin development.rb bạn

Rails.application.routes.default_url_options[:protocol] = 'http' 

và trong tập tin production.rb

Rails.application.routes.default_url_options[:protocol] = 'https' 
Các vấn đề liên quan