Create a report page with 3 tables involved?

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

  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
    HTML tags.

<% @table1.each do |t| %> <% end %>
<%=t.first_name %> <%=t.last_name %>

Rails is just like any other scripting language when it comes to the
parts… you have an object and you display it’s data using the <%= %>
syntax simliar to ASP and JSP.

If none of this makes sense, you need to stop what you’re doing and get
book, preferably the Agile Web D. with Rails book.

Hope that helps… good luck!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs