fix for listing object error

This commit is contained in:
Matthew K. Fu JuYuan 2012-09-19 10:45:03 +08:00
parent 1240064e23
commit 959b6aee12
2 changed files with 10 additions and 5 deletions

View File

@ -74,10 +74,15 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
end end
def setup_vars def setup_vars
@app_title = request.env['HTTP_REFERER'].split('/')[4] if request.env['HTTP_REFERER'].split('/')[4] == "object_auths"
#@app_title = request.fullpath.split('/')[1] if(@app_title == "back_end") @app_key = params[:app_key]
@app_title.gsub!(/[?].*/,'') else
@module_app = ModuleApp.first(conditions: {:key => @app_title} ) @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
end end

View File

@ -20,7 +20,7 @@
</li> </li>
</ul> </ul>
<%= 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'%>
</div> </div>
<%#= label_tag :role, t("admin.roles") %> <%#= label_tag :role, t("admin.roles") %>