Skip to content

Commit

Permalink
Documentation added
Browse files Browse the repository at this point in the history
  • Loading branch information
tscolari committed Sep 2, 2011
1 parent 39a5035 commit 10e5505
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions 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?
Expand All @@ -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?
Expand All @@ -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]
Expand Down

0 comments on commit 10e5505

Please sign in to comment.