Hi, I am learning Radrails and want to tie the web project all together by displaying 3 tables linked together. I want to select one item from the main table, and then link to the other two tables. they will be linked by the key of the first table. It seems that I should create a rhtml in a main table or should I just copy the list.rhtml created by the generator scaffold? I might not make any sense, but I hope I do Jim
on 2006-05-05 20:07
on 2006-05-05 20:22
1. Radrails is a product, not a programming language or framework. 2. controller should get your results @table1 = Table1.find(:all) @table2 = Table2.find(:all) @table3 = Table3.find(:all) 3. your rhtml view should then display them in tablular form using standard HTML tags. <table> <% @table1.each do |t| %> <tr> <td><%=t.first_name %></td> <td><%=t.last_name %></td> <% end %> </table> Rails is just like any other scripting language when it comes to the view parts... you have an object and you display it's data using the <%= %> tag syntax simliar to ASP and JSP. If none of this makes sense, you need to stop what you're doing and get a book, preferably the Agile Web Development with Rails book. Hope that helps... good luck!