Can use table-plus on application.dryml?

19 views
Skip to first unread message

Enrique Moreira

unread,
Aug 15, 2011, 11:45:02 AM8/15/11
to hobo...@googlegroups.com
Hello

I have 2 nested models

Proyecto.rb
has_many: plan_operativos
-----
Plan_operativos.rb
cant:
belongs_to: Proyecto
 
#in the Show page on application.dryml: need a view table-plus instead of : <collection:plan_operativos param/>  <== work fine!
...
<def tag="show-page" for="Proyecto">
...
<collection:plan_operativos param>
               <div>            
                 <table-plus: fields="this,cant"/>
               </div>
             </collection:plan_operativos> 
...

Any Idea?

Best Regards!
Enrique

Bryan Larsen

unread,
Aug 15, 2011, 11:47:21 AM8/15/11
to hobo...@googlegroups.com
use

<collection:plan_operativos for="Proyecto" replace>

since you don't want a table plus inside of collection, you want a
table-plus instead of a collection.

Bryan

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

Enrique Moreira

unread,
Aug 15, 2011, 12:13:41 PM8/15/11
to hobo...@googlegroups.com
Hello bryan
i try this in application.dryml

...
            <collection:plan_operativos for="Proyecto" replace>
               <div>            
                  <table-plus: fields="this,cant"/>
               </div>
             </collection:plan_operativos> 
...

and show next error:


NoMethodError in Proyectos#show

Showing controller: proyectos; dryml-tag: show-page where line #1 raised:

undefined method `member_class' for #<PlanOperativo:0xe2c8694>
if replace below code 
<collection:plan_operativos param/>
instead <collection...> ...</collection> tag work fine! i need a  table-plus for sum values


Regards

Enrique

Bryan Larsen

unread,
Aug 15, 2011, 12:26:08 PM8/15/11
to hobo...@googlegroups.com
I'm glad you figured it out. I realize that I replied without
thinking. I hope that at least my silly response at least got you
started on the right path.

Bryan

kevinpfromnm

unread,
Aug 15, 2011, 12:27:17 PM8/15/11
to hobo...@googlegroups.com
remove the plan_operativos from the collection: replace tag.  By having that after, you're making it a normal tag (instead of a parameter tag) with a context change.

so something like this in the end:

<collection: replace>
  <div>
    <table-plus:plan_operativos ... />
  </div>
</collection:>
Reply all
Reply to author
Forward
0 new messages