Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Stijn Verrept's Profile

GitHub User: rept

Comments by Stijn Verrept

Avatar

This is the correct syntax for scoping in rails 4+

scope :with_role, -> role { where("roles_mask & #{2**ROLES.index(role.to_s)} > 0 ") }
Avatar

No idea why but I needed to change:

$(this).closest('fieldset').hide()
into:
$(this).parent().hide()

for the removing to work.

Avatar

Exactly what I was looking for. Sure hope you come back to do more RailsCasts soon Ryan!

Avatar

Did you find a solution for this? Looking for the same.

Avatar

Could you share the code? Original isn't available anymore.

Avatar

Hi, can you share this again, link isn't available.