Frederick Cheung wrote:
> On Jun 6, 5:05�pm, Jay Covington <[email protected]>
> wrote:
>> >> @statcount = table.count(:all, :conditions => statcount_query).to_s
>> ("grocery") that �contains: "title", "item1", "item2", "item3", "item4,
>> "item5". It was built behind a scaffold. So the index.rhtml shows all of
>> my lists. Ok, no problem there. Here is example output:
>>
>
> What I meant by that is what is the structure of your data (columns,
> etables etc.)
>
> Fred
Here is the format of index.rhtml and database layout:
<table>
<% @listhubs.in_groups_of(3, false) do |row_listhubs| %>
<tr>
<% for listhub in row_listhubs %>
<td><%= listhub.title +
(link_to 'edit', edit_listhub_path(listhub) + '<br>' + listhub.item1 +
'<br>' + listhub.item2 + '<br>' + listhub.item3+ '<br>' + listhub.item4+
'<br>' + listhub.item5+ '<br>' + listhub.item6 + '<br>' + listhub.item7
+ '<br>' + listhub.item8 + '<br>' + listhub.item9 + '<br>' +
listhub.item10 %>
</td>
<% end %>
</tr>
<% end %>
</table>
---------------------------------------------------------------------------
class CreateListhubs < ActiveRecord::Migration
def self.up
create_table :listhubs do |t|
t.column :title, :string
t.column :item1, :string
t.column :item2, :string
t.column :item3, :string
t.column :item4, :string
t.column :item5, :string
t.column :item6, :string
t.column :item7, :string
t.column :item8, :string
t.column :item9, :string
t.column :item10, :string
end
end
def self.down
drop_table :listhubs
end
end
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---