jeffbrody (1) [Avatar] Offline

I got to the end of Chapter 8 with all my features passing, but when I actually tried it out I find it's not displaying the checkbox states correctly when I reload a user - they're just blank. Am I jumping ahead, or should they be displaying the current state of the user permissions?
rehali (2) [Avatar] Offline
Re: Chapter 8 Saving permissions
there's a post by dijeron on 2 Jan 2012 which explains the solution:

in listing 8.16 on page 202 the following code

<%= check_box_tag "permissions[#{}][#{name}]", <br /> @ability.can?(name.to_sym, project) %>

should be:

<%= check_box_tag "permissions[#{}][#{name}]", "", <br /> @ability.can?(name.to_sym, project) %></td>

i.e. you need to add a "" blank second parameter so the checkbox will show the correct state (checked="checked")