OSDN Git Service

refs #1606 スマホ: 商品一覧のページネートを利用できない不具合を修正
authorYOSHIDA Hiroki <hyoshida@appirits.com>
Tue, 21 May 2013 10:36:40 +0000 (19:36 +0900)
committerYOSHIDA Hiroki <hyoshida@appirits.com>
Tue, 21 May 2013 10:36:40 +0000 (19:36 +0900)
app/helpers/application_helper.rb
app/views/products/index_mobile_smartphone.html.erb

index e51b8d8..6ee75b9 100644 (file)
@@ -6,7 +6,7 @@ module ApplicationHelper
   def link_parameter(name, option)
     param_datas = {}
     #DOCOMOとAUの場合、リンクに日本語のパラメター値が付いている時の文字化けの問題対応
-    params.each{ |key, value| param_datas[key.to_sym] = ((request.mobile? && !request.mobile.is_a?(Jpmobile::Mobile::Softbank)) ? value.tosjis : value) }
+    params.each{ |key, value| param_datas[key.to_sym] = (is_softbank_mobile?(request) ? value.tosjis : value) }
     option.each{ |key, value| param_datas[key.to_sym] = value }
     link_to name, param_datas
   end
@@ -119,6 +119,12 @@ module ApplicationHelper
     end
   end
 
+  private
+
+  def is_softbank_mobile?(request_obj)
+    request_obj.mobile? && !request_obj.mobile.respond_to?(:smartphone?) && !request_obj.mobile.is_a?(Jpmobile::Mobile::Softbank)
+  end
+
 #   def date_select_tag(name, value = nil, options = {})
 #     defaults = { :discard_type => true }
 #     options  = defaults.merge(options)
index 44baa14..34a9f87 100644 (file)
   <% end %>
 
   <!-- ページング -->
-  <%param_datas = {}%>
-  <%params.each{ |key, value| param_datas[key.to_sym] = ((request.mobile? && !request.mobile.is_a?(Jpmobile::Mobile::Softbank)) ? value.tosjis : value) }%>
-<!--  page numbers -->
-  <div id="pages">  <%= will_paginate(@products,:params=>param_datas) %></div>
+  <div id="pages">  <%= will_paginate(@products) %></div>
   <div class="listOrder"><%= link_order "price" %>│<%= link_order "update" %></div>
 
 <% else %>