Module: HasMobileFormat::InstanceMethods

Defined in:
lib/rails-jquerymobile/has_mobile_format.rb

Instance Method Summary collapse

Instance Method Details

#mobile?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/rails-jquerymobile/has_mobile_format.rb', line 17

def mobile?
  raise "not implemented yet"
end

#prepare_for_mobile_formatsObject

TODO: following should be private?



21
22
23
24
25
26
27
28
29
# File 'lib/rails-jquerymobile/has_mobile_format.rb', line 21

def prepare_for_mobile_formats
  remember_format(params[:mobile].to_s)
  puts "before assigning: request.format=#{request.format}, " +
       "session[:remembered_format]=#{session[:remembered_format]}" if debug?
  format = session[:remembered_format]
  puts "determined format=#{format}" if debug?
  request.format = format unless format.blank?
  puts "request.format=#{request.format}" if debug?
end