Refactor HomeController#toggle_mobile

closes #6260
This commit is contained in:
Mikica Ivosevic 2015-07-28 18:46:01 +02:00 committed by Jonne Haß
parent 7c611ca509
commit 78b0fbbee6
2 changed files with 2 additions and 7 deletions

View file

@ -6,6 +6,7 @@
* Drop outdated/unused mbp-respond.min.js and mbp-modernizr-custom.js [#6257](https://github.com/diaspora/diaspora/pull/6257)
* Refactor ApplicationController#after\_sign\_out\_path\_for [#6258](https://github.com/diaspora/diaspora/pull/6258)
* Extract StatusMessageService from StatusMessagesController [#6280](https://github.com/diaspora/diaspora/pull/6280)
* Refactor HomeController#toggle\_mobile [#6260](https://github.com/diaspora/diaspora/pull/6260)
## Bug fixes
* Fix indentation and a link title on the default home page [#6212](https://github.com/diaspora/diaspora/pull/6212)

View file

@ -26,13 +26,7 @@ class HomeController < ApplicationController
end
def toggle_mobile
if session[:mobile_view].nil?
# we're most probably not on mobile, but user wants it anyway
session[:mobile_view] = true
else
# switch from mobile to normal html
session[:mobile_view] = !session[:mobile_view]
end
session[:mobile_view] = session[:mobile_view].nil? ? true : !session[:mobile_view]
redirect_to :back
end