diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index c1a0070..f126720 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -35,7 +35,7 @@ class PagesController < ApplicationController def show path = request.path.split('/') - if path.size <= 2 or path.last.eql?("mobile") + if path.size <= 2 redirect_to root_path else if path.last.include? '-' @@ -237,7 +237,7 @@ class PagesController < ApplicationController def get_view page = Page.find(params[:id]) rescue Page.root if page == Page.root - @view = File.join(Rails.root, 'app', 'templates', "#{@key}", 'home#{$mobile}/index.html.erb') + @view = File.join(Rails.root, 'app', 'templates', "#{@key}", "home#{$mobile}/index.html.erb") else module_name = page.module.downcase.singularize @view = File.join(Rails.root, 'app', 'templates', "#{@key}", "modules#{$mobile}/#{module_name}/index.html.erb") @@ -266,7 +266,7 @@ class PagesController < ApplicationController if page.page_id == "" || page.page_id == nil false else - File.join("../../templates", "#{@key}", "/#{@home}#{$mobile}/page.html.erb") + File.join("../../templates", "#{@key}", "/home#{$mobile}/page.html.erb") end # elsif request[:action] == "show" || request[:action] == "moduleShow" # File.join("../../templates", "themes", "#{@key}", '/home/page.html.erb') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4ff629f..5a3a432 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -279,7 +279,7 @@ module ApplicationHelper if loc != locale url = url.gsub("/#{locale.to_s}/","/#{loc.to_s}/") url = url.gsub("locale=#{locale.to_s}","locale=#{loc.to_s}") if url == request.original_fullpath - url = url + "?locale=#{loc.to_s}" if url == request.original_fullpath + url = url + "#{url.include?("?") ? "&" : "?"}locale=#{loc.to_s}" if url == request.original_fullpath end url end