The partial _crud_maint_table in the shared folder has this code
snippet:
...
- crud_maint_table.each do |a_rec|
%tr{ :class => cycle("odd","even") }
- columns.each_with_index do |col, i|
%td{ :class => (i == 0 ? 'first' : nil) }
...
See the crud_maint_table.each loop? That works in rails 2.3.x but not
in rails 3.
Please advise.
thanks.
Bharat
Well,I met the same problem.
I had some debug, it seems that rails treat :object as :collection, so
the crud_maint_table actually is the first element of the array obj.
I'm not sure it's a bug or sth changed since 3 and I haven't found any
solution
The partial _crud_maint_table in the shared folder has this code
snippet:
...
- crud_maint_table.each do |a_rec|
%tr{ :class => cycle("odd","even") }
- columns.each_with_index do |col, i|
%td{ :class => (i == 0 ? 'first' : nil) }
...
See the crud_maint_table.each loop? That works in rails 2.3.x but not
in rails 3.
Please advise.
thanks.
Bharat
Well,I met the same problem.
I had some debug, it seems that rails treat :object as :collection, so
the crud_maint_table actually is the first element of the array obj.
I'm not sure it's a bug or sth changed since 3 and I haven't found any
solution
When I tried to use :locals, there are some strange text:
Hello,
You are right about the object deprecation in Rails 3. I solved the
problem the same way you did. Instead of passing the table name in
object. I now pass it in the locals hash.
Hope this helps.
Bharat
is not working in rails 3,it pass the first element of the array
@sth(I'm not sure what would happen if @sth is not an array),thus you
can't call each in the template.You have to use :locals =>{:sth
=>@sth}.Seems a little complicated,is it a bug or some change not
mentioned in the changelog?
Before I realize this I changed the view a little,added <%= Tutor.each
.....%>,and got that text.