can_view? behaves oddly in a repeat context
Reported by Matt Jones | May 21st, 2010 @ 05:26 PM | in Hobo 1.3 (Rails 3)
This code:
<do repeat="some-association">
<do if="&can_view?">
<view:some-field />
</do>
</do>
fails messily - it appears that the top case in can_view? (around line 295 of hobo_helper.rb) is trying to check this_parent (which is the array) and this_field (which is a number) rather than the (somewhat) expected behavior of checking just 'this'. If this is intentional, we should fix the docs.
Comments and changes to this ticket
-
Matt Jones September 15th, 2011 @ 06:47 PM
- State changed from new to open
- Assigned user set to Matt Jones
- Milestone changed from Hobo 1.1 to Hobo 1.3 (Rails 3)
- Milestone order changed from 0 to 0
-
Matt Jones September 20th, 2011 @ 04:20 PM
(from [a450d53d76413d6c47616a13309ce873053b34f7]) [#964] [#726] fix handling of can_view when repeating over an array https://github.com/tablatom/hobo/commit/a450d53d76413d6c47616a13309...
-
Matt Jones September 20th, 2011 @ 04:20 PM
- State changed from open to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Tags
Referenced by
- 964 objects in relation not shown unless relation loaded Looks like a relative of #726.
- 726 can_view? behaves oddly in a repeat context (from [a450d53d76413d6c47616a13309ce873053b34f7]) [#964] ...
- 964 objects in relation not shown unless relation loaded (from [a450d53d76413d6c47616a13309ce873053b34f7]) [#964] ...
- 964 objects in relation not shown unless relation loaded On further digging, this was the same issue as #726 - lon...
- 964 objects in relation not shown unless relation loaded Thanks for the insight, Tim. I suspect the issue that you...