Sha256: bc9055de9ee2b09387ba7a107c731748faff393235c17027a10231cea46d0dd2
Contents?: true
Size: 1.33 KB
Versions: 2
Compression:
Stored size: 1.33 KB
Contents
# -*- coding: utf-8 -*- ActiveSupport.on_load(:action_controller) do require 'jpmobile/docomo_guid' require 'jpmobile/filter' require 'jpmobile/helpers' require 'jpmobile/hook_action_controller' require 'jpmobile/hook_action_view' require 'jpmobile/trans_sid' require 'jpmobile/hook_test_request' end ActiveSupport.on_load(:action_dispatch) do require 'jpmobile/hook_action_dispatch' end ActiveSupport.on_load(:before_configuration) do # MobileCarrierのみデフォルトで有効 config.middleware.insert_before ActionDispatch::ParamsParser, Jpmobile::Rack::MobileCarrier module Rails class Application class Configuration def jpmobile @jpmobile ||= ::Jpmobile.config end end end end end module Jpmobile module ViewSelector def self.included(base) base.class_eval do before_filter :register_mobile self._view_paths = self._view_paths.dup self.view_paths.unshift(*self.view_paths.map {|resolver| Jpmobile::Resolver.new(resolver.to_path) }) end end def register_mobile if request.mobile # register mobile self.lookup_context.mobile = request.mobile.variants end end def disable_mobile_view! self.lookup_context.mobile = [] end private :register_mobile, :disable_mobile_view! end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jpmobile-4.1.0 | lib/jpmobile/rails.rb |
jpmobile-4.1.0.rc1 | lib/jpmobile/rails.rb |