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 b0fc4adb..7f4ea0fa 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 d07e9a87..369bfa22 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 8bff0fa0..17a38e90 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 428d689b..3e0df561 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 eecc8226..ec92ea84 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 247ca214..ff2ea10f 100644 --- a/app/views/mobile/announcement.mobile.erb +++ b/app/views/mobile/announcement.mobile.erb @@ -1,7 +1,7 @@