diff --git a/lib/mobylette/controllers/helpers.rb b/lib/mobylette/controllers/helpers.rb index 8308f12..9b42399 100644 --- a/lib/mobylette/controllers/helpers.rb +++ b/lib/mobylette/controllers/helpers.rb @@ -1,8 +1,18 @@ module Mobylette module Controllers + + # + # Mobylette::Controllers::Helpers include few methods to + # include different css/js files for the mobile and for + # the normal version of your layout + # + # Personal note: I'm rethinking and I guess that, since you + # may have (and probably will) a different layout file for the + # "normal" and mobile version, you probably wont use this at all module Helpers extend ActiveSupport::Concern + # Adds a "_mobile" sulfix to the files you include (when the request is mobile) def mobylette_stylesheet_link_tag(*sources) options = sources.extract_options! if is_mobile_request? @@ -12,6 +22,7 @@ def mobylette_stylesheet_link_tag(*sources) end end + # Adds a "_mobile" sulfix to the files you include (when the request is mobile) def mobylette_javascript_include_tag(*sources) options = sources.extract_options! if is_mobile_request? @@ -23,6 +34,9 @@ def mobylette_javascript_include_tag(*sources) private + # + # Anex the "_mobile" sulfix to each string in the array, + # before the .#{extension}, if it exists def sulfix_mobile_assets(sources, extension) sources.each_index do |index| source = sources[index]