Changed the mobile/app to /app

This commit is contained in:
Saurabh Bhatia 2014-04-07 18:49:29 +08:00
parent 9fecdd9739
commit a7084c9cde
2 changed files with 17 additions and 5 deletions

View File

@ -468,7 +468,7 @@ class ApplicationController < ActionController::Base
def prepare_for_mobile
if (@site.mobile_on.eql?(true) && mobile_device?)
mobile_app_path = "/mobile/app"
mobile_app_path = "/app"
mobile_path = "/mobile"
session[:mobile_param] = if request.path.eql?(mobile_path)
'1'
@ -479,12 +479,12 @@ class ApplicationController < ActionController::Base
end
request.format = :mobile if mobile_device?
elsif (@site.mobile_on.eql?(false) && mobile_device?)
mobile_app_path = "/mobile/app"
mobile_app_path = "/app"
mobile_path = "/mobile"
session[:mobile_param] = if request.path.eql?(mobile_app_path)
session[:mobile_param] = if (request.path.eql?(mobile_app_path) && @site.mobile_api_openness_on.eql?(true))
'1'
elsif request.path.eql?(mobile_path)
'0'
redirect_to root_path(mobile: 0)
elsif params[:mobile]
params[:mobile]
else

View File

@ -416,7 +416,19 @@ Orbit::Application.routes.draw do
end
end
scope '/mobile(/:app)' do
scope '/:app' do
match '/announcement' => 'mobile#announcement', :as => 'mobile_announcement'
match '/announcement_content/:id' => 'mobile#announcement_content', :as => 'mobile_announcement_content'
match '/dialog_contact' => 'mobile#dialog_contact', :as => 'mobile_dialog_contact'
match '/dialog_copyright' => 'mobile#dialog_copyright', :as => 'mobile_dialog_copyright'
match '/dialog_language' => 'mobile#dialog_language', :as => 'mobile_dialog_language'
match '/map' => 'mobile#map', :as => 'mobile_map'
match '/page' => 'mobile#page', :as => 'mobile_page'
match '/page_content/:id' => 'mobile#page_content', :as => 'mobile_page_content'
root :to => 'mobile#index', :as => 'mobile'
end
scope '/mobile' do
match '/announcement' => 'mobile#announcement', :as => 'mobile_announcement'
match '/announcement_content/:id' => 'mobile#announcement_content', :as => 'mobile_announcement_content'
match '/dialog_contact' => 'mobile#dialog_contact', :as => 'mobile_dialog_contact'