Jpmobileのget_position_link_toのアンカーテキストを変更したい
$RAILS_ROOT/vendor/plugins/jpmobile/lib/jpmobile/helpers.rbの中のget_position_link_toを以下のように変更。
AUで二つのGPSリンクが表示されるのも、一つにするようにした。
なんだかapp/helpersの中でオーバーライドするのがうまくいかなかったので、とりあえず直接vendor/pluginsの中を編集しちゃった。
(変更前)
LANG : RUBY
-
def get_position_link_to(options={})
-
options = options.symbolize_keys
-
show_all = options.delete(:show_all)
-
-
s = []
-
if show_all || request.mobile.instance_of?(Mobile::Docomo)
-
s <<docomo_foma_gps_link_to( options[:message] ? options[:message] : "DoCoMo FOMA(GPS)", options)
-
end
-
if show_all || request.mobile.instance_of?(Mobile::Au)
-
s <<au_gps_link_to("au(GPS)", options)
-
s <<au_location_link_to("au(antenna)", options)
-
end
-
if show_all || request.mobile.instance_of?(Mobile::Jphone)
-
s <<jphone_location_link_to("Softbank(antenna)", options)
-
end
-
if show_all || request.mobile.instance_of?(Mobile::Vodafone) || request.mobile.instance_of?(Mobile::Softbank)
-
s <<softbank_location_link_to("Softbank 3G(GPS)", options)
-
end
-
if show_all || request.mobile.instance_of?(Mobile::Willcom)
-
s <<willcom_location_link_to("Willcom", options)
-
end
-
return s.join("<br />\n")
-
end
(変更後)
LANG : RUBY
-
def get_position_link_to(options={})
-
options = options.symbolize_keys
-
show_all = options.delete(:show_all)
-
-
s = []
-
if show_all || request.mobile.instance_of?(Mobile::Docomo)
-
s <<docomo_foma_gps_link_to( options[:message] ? options[:message] : "DoCoMo FOMA(GPS)", options)
-
end
-
if show_all || request.mobile.instance_of?(Mobile::Au)
-
s <<au_gps_link_to( options[:message] ? options[:message] : "au(GPS)", options) ? true :
-
s <<au_location_link_to( options[:message] ? options[:message] : "au(antenna)", options)
-
end
-
if show_all || request.mobile.instance_of?(Mobile::Jphone)
-
s <<jphone_location_link_to( options[:message] ? options[:message] : "Softbank(antenna)", options)
-
end
-
if show_all || request.mobile.instance_of?(Mobile::Vodafone) || request.mobile.instance_of?(Mobile::Softbank)
-
s <<softbank_location_link_to( options[:message] ? options[:message] : "Softbank 3G(GPS)", options)
-
end
-
if show_all || request.mobile.instance_of?(Mobile::Willcom)
-
s <<willcom_location_link_to( options[:message] ? options[:message] : "Willcom", options)
-
end
-
return s.join("<br />\n")
-
end












この記事がお役に立ちましたら、一言コメントもらえると嬉しいですm_ _m