hmmm not really sure if I understand your question but here goes..
class AnswerController < ApplicationController
def index
@questions = Question.find(:all)
end
end
If you have this code on your controller then the reason why it doesn't
recognize your method is because @questions here is an Array of
Questions. So you have to loop through your array and display each
question.
So i think you have to do this on your index.html.erb
<% @questions.each do |q| %>
<%= q.question %>
<% 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.