You've got the colon form when specifying the collection:

   <table-plus:my_venues ...

Which is essentially equivalent to

    <table-plus with="&current_user.my_venues"  ...

because you specified the with="&current_user" further up.

If you removed both the with="&current_user" and the :my_venues, then
the table plus should use whatever your controller action puts into
the "this" variable.   So you'd probably want to define an index
action in your controller that looks something like:

def index
  self.this = ....
  hobo_index
end

Bryan


On Wed, Oct 31, 2012 at 12:46 PM, tonym <[email protected]> wrote:
> This one's baffled me - just can't figure out why show-index needs
> 'with="&current_user"?
> I first came across this in the agility tutorial, found a fix here and
> thought nothing of it.  But with my project, it's become a problem...
> I have all my permissions sorted in my model - admin can view all records,
> standard users view only the records they've created.
> The permissions worked fine, the views return the right records, until I
> customized the page through <show-index>
>
> <show-index> always returns blank, unless I use the 'with="&current_user"
> (that's the fix, discuss here in another thread).
> But if I use the 'with', then the admin can only view their own records,
> thus breaking my model...  Can I get the index page up without using 'with',
> and use the rules in my model?
>
> Here's my view code...
>
> <if test="&current_user.signed_up?">
>   <index-page with="&current_user">
>    <top-page-nav: replace />
>    <bottom-page-nav: replace />
>     <collection: replace>
>       <table-plus:my_venues fields="name, venuetype, local_area, telephone,
> approval" />
>     </collection:>
>   </index-page>
> </if>
> <else>
>   <page title="No Access">
>   </page>
> </else>
>
> Thanks, Anthony.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/A3ZpdWAO9NYJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to