RailsCasts Pro episodes are now free!

Learn more or hide this

Matt Connolly's Profile

GitHub User: soundevolution

Comments by Matt Connolly

Avatar

You probably want to add something like this if you don't want to break xml or json output, (with responds_to blocks):

ruby
def prepare_for_mobile
  if request.format == 'text/html'
    session[:mobile_param] = params[:mobile] if params[:mobile]
    request.format = :mobile if mobile_device?
  end
end