dlt/pilha — Issue #11: How do I use Ruby or Rails methods on returned collections?
Author: marcamillion
Created: 2011-12-15 11:19:55+00:00
State: open

how I access each of the elements?

For instance:

@questions = Question.find_by_user_id(params[:id], :body => true, :pagesize => 10)

When I do:

@questions.first

It returns blank.

Am I missing something?

I also tried sorting the results, but it is giving me a problem.

I did this in my controller:

@questions = Question.find_by_user_id(params[:id]).order("created_at ASC")

And it produced this error:

undefined method `order' for #