jeffbrody (1) [Avatar] Offline
#1
Hi,

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
#2
Re: Chapter 8 Saving permissions
there's a post by dijeron on 2 Jan 2012 which explains the solution:

Quote:
in listing 8.16 on page 202 the following code

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

should be:

<%= check_box_tag "permissions[#{project.id}][#{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")