lib/mobile_enhancements/railtie.rb in mobile-enhancements-0.0.1 vs lib/mobile_enhancements/railtie.rb in mobile-enhancements-0.0.2

- old
+ new

@@ -14,9 +14,15 @@ ActionController::Base.layout :determine_layout # if we have a custom mobile format if format = MobileEnhancements.configuration.mobile_format # register it as an alias to the HTML mime-type Mime::Type.register_alias "text/html", format + # setup the format calculation + ActionController::Base.class_eval do + before_filter do |controller| + controller.request.format = controller.determine_format + end + end end end end end \ No newline at end of file