Forum: Rails Engines roles edit checkboxes all offset

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jim M. (Guest)
on 2006-03-29 03:57
I have installed the latest trunk versions of engines/login/user, and am
on rails 1.1.

I ran rake sync_permissions to get a few more controllers and actions
added.

When I go to edit roles user the Permissions checkboxes for the User
role are clear and the check boxes are set and show up in the last
column of an unrelated controller instead. Also clicking check all or
none sets or clears the checkboxes of another controller, it seems they
are all offset by one or two... very weird, does anyone else see this
before I dive into the code to debug it?

Thanks
Jim M. (Guest)
on 2006-03-29 06:01
Ok fixed it, for some reason the order was different in the header and
the body of the table this diff shows the simple fix, just sort the
headers the same way the body of the table is sorted

*** vendor/plugins/user_engine/app/views/role/_form.rhtml
2006-03-28 17:59:50.733427091 -0800
--- ../../svnengines/user_engine/app/views/role/_form.rhtml
2006-03-27 16:45:59.000000000 -0800
***************
*** 15,21 ****
    <table id="role_permission_table">
      <thead><tr>

!     <% @all_actions.keys.sort.each do |controller_name|
          controller_id = controller_name.gsub("/", "_")
          #perms_id = controller_id + "_perms"
       %>
--- 15,21 ----
    <table id="role_permission_table">
      <thead><tr>

!     <% @all_actions.each_key do |controller_name|
          controller_id = controller_name.gsub("/", "_")
          #perms_id = controller_id + "_perms"
       %>
This topic is locked and can not be replied to.