From 91830f86aaa162d572f3d86a1eabd380cb145421 Mon Sep 17 00:00:00 2001 From: chris Date: Wed, 16 Jan 2013 08:14:42 +0800 Subject: [PATCH] Fix bug for mobile app routes --- app/controllers/application_controller.rb | 2 +- app/controllers/mobile_controller.rb | 2 +- app/views/mobile/_footer.mobile.erb | 4 ++-- app/views/mobile/_header.mobile.erb | 2 +- app/views/mobile/_menu.mobile.erb | 6 ++--- app/views/mobile/announcement.mobile.erb | 2 +- app/views/mobile/index.mobile.erb | 2 +- app/views/mobile/page.mobile.erb | 2 +- config/routes.rb | 28 +++++++++++------------ 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b0fc4adb5..7f4ea0fa8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -130,7 +130,7 @@ class ApplicationController < ActionController::Base respond_to do |format| format.html { render :text => parse_page_content(@item), :layout => 'page_layout' } format.rss { render_main_rss } - format.mobile { redirect_to mobile_path } + format.mobile { redirect_to mobile_path(:app => params[:app]) } end else render :text => '404 Not Found' diff --git a/app/controllers/mobile_controller.rb b/app/controllers/mobile_controller.rb index d07e9a878..369bfa220 100644 --- a/app/controllers/mobile_controller.rb +++ b/app/controllers/mobile_controller.rb @@ -54,7 +54,7 @@ class MobileController < ApplicationController protected def no_footer_for_app - @no_footer = true if request.path.starts_with?("/app") + @no_footer = true if request.path =~ /app/ end end diff --git a/app/views/mobile/_footer.mobile.erb b/app/views/mobile/_footer.mobile.erb index 8bff0fa03..17a38e904 100644 --- a/app/views/mobile/_footer.mobile.erb +++ b/app/views/mobile/_footer.mobile.erb @@ -7,12 +7,12 @@ <% end %>
  • - <%= link_to mobile_map_path, {"data-transition" => "flip"} do %> + <%= link_to mobile_map_path(:app => params[:app]), {"data-transition" => "flip"} do %> <% end %>
  • - <%= link_to mobile_dialog_contact_path, {"data-rel" => "dialog"} do %> + <%= link_to mobile_dialog_contact_path(:app => params[:app]), {"data-rel" => "dialog"} do %> <% end %>
  • diff --git a/app/views/mobile/_header.mobile.erb b/app/views/mobile/_header.mobile.erb index 428d689bd..3e0df5619 100644 --- a/app/views/mobile/_header.mobile.erb +++ b/app/views/mobile/_header.mobile.erb @@ -3,7 +3,7 @@ <%= image_tag asset_path('mobile/logo.png') %> - <%= link_to mobile_dialog_language_path, {:class => "ui-btn-right language", "data-iconpos" => "notext", "data-icon" => "search", "data-rel" => "dialog"} do %> + <%= link_to mobile_dialog_language_path(:app => params[:app]), {:class => "ui-btn-right language", "data-iconpos" => "notext", "data-icon" => "search", "data-rel" => "dialog"} do %> <% end %> \ No newline at end of file diff --git a/app/views/mobile/_menu.mobile.erb b/app/views/mobile/_menu.mobile.erb index eecc82263..ec92ea84d 100644 --- a/app/views/mobile/_menu.mobile.erb +++ b/app/views/mobile/_menu.mobile.erb @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/app/views/mobile/announcement.mobile.erb b/app/views/mobile/announcement.mobile.erb index 247ca2148..ff2ea10fe 100644 --- a/app/views/mobile/announcement.mobile.erb +++ b/app/views/mobile/announcement.mobile.erb @@ -1,7 +1,7 @@