fixed bug caused by wrong id in controller

pull/6827/head
Jens Ulferts 14 years ago
parent c2b5ef878a
commit fd8c0441b2
  1. 4
      app/controllers/principal_roles_controller.rb
  2. 2
      app/views/principal_roles/_show_table_row.html.erb

@ -8,7 +8,7 @@ class PrincipalRolesController < ApplicationController
format.js do
render(:update) do |page|
principal_roles.each do |role|
page.remove "principal_role_option_#{role.role.id}"
page.remove "principal_role_option_#{role.role_id}"
page.insert_html :top, 'table_principal_roles_body',
:partial => "principal_roles/show_table_row",
:locals => {:principal_role => role}
@ -26,7 +26,7 @@ class PrincipalRolesController < ApplicationController
format.js do
render(:update) do |page|
if @principal_role.valid?
page.replace "principal_role-#{@principal_role.role_id}",
page.replace "principal_role-#{@principal_role.id}",
:partial => "principal_roles/show_table_row",
:locals => {:principal_role => @principal_role}
else

@ -1,5 +1,5 @@
<tr id="principal_role-<%= principal_role.id %>">
<td class="role assigned_global_role_<%= principal_role.role.id%>">
<td class="role assigned_global_role_<%= principal_role.role_id%>">
<%=h principal_role.role %>
</td>
<%= call_hook(:principal_roles_table_row, :user => @user, :principal_role => principal_role )%>

Loading…
Cancel
Save