From: Brian Candler Date: 2010-01-27T22:58:08+09:00 Subject: Re: dynamically set named_scope based on current_user John Merlino wrote: > That's the > problem - to dynamically set that value in a named_scope. Don't use a named scope; create an anonymous scope dynamically. class ApplicationController def students(staff_id = session[:staff_id]) Student.scoped(:conditions => {:staff_id => staff_id}) end end @students = students.find(...) Or you can make a helper method using with_scope. -- Posted via http://www.ruby-forum.com/.