How about creating a method in your model that
will do two finds.  The first will return all questions with
that tag.  The second will return those without that
tag.

Have this model return the sum of the two finds.

Using two named_scopes called with_tag and without_tag
might be a nice way of doing this, and then in your class
method

def self.with_tag_on_top(tag)
  self.with_tag(tag) + self.without_tag(tag)
end

so in your controller you can have something like

@questions = Question.with_tag_on_top(params[:tag]).paginate(:page =>
params[:page])

Franz

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