Closed rust closed 14 years ago
module ActionView module Helpers module UrlHelper alias :url_for_without_jpmobile :url_for def url_for(options = {}) url = url_for_without_jpmobile(options)
if options.kind_of?(String) and @controller and @controller.trans_sid_mode
skey = ActionController::Base.session_options.merge(@controller.request.session_options || {})[:key]
sid = @controller.request.session_options[:id] rescue session.session_id
unless options =~ /#{skey}/
jpmobile_url = URI.parse(url)
if jpmobile_url.query
jpmobile_url.query += "&#{skey}=#{sid}"
else
jpmobile_url.query = "#{skey}=#{sid}"
end
url = jpmobile_url.to_s
end
end
url
end
end
end end
こんな感じで直りますが,どうしましょうか.
Rails 3 でなんとかなるかもと言うことで close
link_to "Link", "/controller/action/id"
のような場合にセッションIDが付加されない
http://d.hatena.ne.jp/t-taira/20100212/1265929726