I am trying to get data out of a database to my rhtml file. The files
look like this:

Model
-------
mystuff.rb

class Mystuff < ActiveRecord::Base
  set_table_name "mytable"
  set_primary_key "id"
end


Controllers
--------------

mystuff_controller.rb

require 'Mystuff'

class MystuffController < ApplicationController

    def read

       @me =  Mystuff.find( :all)

    end
  end


Index
----------

Index.html.erb

<h1>Mystuff#index</h1>
<p><%mystuff.each do |mr|%></p>
<h1>mr.m1</h1>
<% end %>


Thanks for you help on yet another stupid newbie question.


Mark
-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to