From 959b6aee12ae9132b5c0a09e241927355e8d324c Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 19 Sep 2012 10:45:03 +0800 Subject: [PATCH] fix for listing object error --- .../admin/object_auths_new_interface_controller.rb | 13 +++++++++---- .../object_auths_new_interface/setting.html.erb | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/object_auths_new_interface_controller.rb b/app/controllers/admin/object_auths_new_interface_controller.rb index ac06602a..3391fbc2 100644 --- a/app/controllers/admin/object_auths_new_interface_controller.rb +++ b/app/controllers/admin/object_auths_new_interface_controller.rb @@ -74,10 +74,15 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController end def setup_vars - @app_title = request.env['HTTP_REFERER'].split('/')[4] - #@app_title = request.fullpath.split('/')[1] if(@app_title == "back_end") - @app_title.gsub!(/[?].*/,'') - @module_app = ModuleApp.first(conditions: {:key => @app_title} ) + if request.env['HTTP_REFERER'].split('/')[4] == "object_auths" + @app_key = params[:app_key] + else + @app_key = request.env['HTTP_REFERER'].split('/')[4] + end + + #@app_key = request.fullpath.split('/')[1] if(@app_key == "back_end") + @app_key.gsub!(/[?].*/,'') + @module_app = ModuleApp.first(conditions: {:key => @app_key} ) end end \ No newline at end of file diff --git a/app/views/admin/object_auths_new_interface/setting.html.erb b/app/views/admin/object_auths_new_interface/setting.html.erb index e66330c7..d3853c25 100644 --- a/app/views/admin/object_auths_new_interface/setting.html.erb +++ b/app/views/admin/object_auths_new_interface/setting.html.erb @@ -20,7 +20,7 @@ - <%= link_to t("admin.object_auth.list_title_of_users",:auth_title => @ob_auth.title), admin_object_auth_ob_auth_show_path , :class=>'preview_trigger btn btn-success pull-right'%> + <%= link_to t("admin.object_auth.list_title_of_users",:auth_title => @ob_auth.title), admin_object_auth_ob_auth_show_path(:app_key=>@module_app.key) , :class=>'preview_trigger btn btn-success pull-right'%> <%#= label_tag :role, t("admin.roles") %>