> This hack would let you use it outside a form.  If Tom doesn't think
> it's gross, I can add it to edge hobo.

It is kinda gross : )

I was thinking of adding a this_index, which kinda matches with  
this_field, this_parent etc. Should workin any 'repeat' context

Tom


On 14 Apr 2009, at 21:36, Bryan Larsen wrote:

>
> If you're in a form, you can use form_field_path:
>
>  <form>
>    <table-plus with="&@stories" fields="title, this, tasks.count,
> status">
>          <title-view:>
>            <%= form_field_path[-2] %>
>          </title-view:>
>    </table-plus>
>  </form>
>
> for the first row, form_field_path contains:  ['project', 'stories',
> 0, 'title'].
>
> This hack would let you use it outside a form.  If Tom doesn't think
> it's gross, I can add it to edge hobo.
>
> diff --git a/hobo/lib/hobo/dryml/template_environment.rb b/hobo/lib/
> hobo/dryml/template_environment.rb
> index adc065b..29e1928 100644
> --- a/hobo/lib/hobo/dryml/template_environment.rb
> +++ b/hobo/lib/hobo/dryml/template_environment.rb
> @@ -287,6 +287,9 @@ module Hobo::Dryml
>         if @_form_field_path
>           @_form_field_path += path
>           @_form_field_paths_by_obje...@_this] = @_form_field_path
> +        else
> +          @_form_field_path = path
> +          @_form_field_paths_by_object = {...@_this =>
> @_form_field_path}
>         end
>
>         yield
>
>
> On Apr 13, 7:54 pm, Tiago Franco <[email protected]> wrote:
>> Hi,
>>
>> I'm currently displaying memberships in a table-plus, like:
>>
>>  <table-plus:memberships fields="user, team, score, notes">
>> ...
>>
>> I would like to have a column with the row number, a simple counter
>> from 1 to memberships.size().
>>
>> Is there a straightforward way to do it? I though in creating a  
>> method
>> in the membership to provide its position in the collection, but this
>> seems like a dumb hack.
>>
>> Thanks,
>>   TF
> >


--~--~---------~--~----~------------~-------~--~----~
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