how to order @project.tasks?

I can access my a project's tasks by @project.tasks.
But how cam I order them by name?
Currently it orders by 'id'

Add :order in your has_many.

Something like this:

class Project < …
has_many :tasks, :order => “tasks.name ASC”

end

in model project.rb

has_many :task, :order => “name ASC”

That should be has_many :tasks

Be aware of correct pluralization on has_many.