I have a form that has a virtual attribute 'contact_name'. In the setter method for this, I need to scope the query through current_user.contacts.find (etc). But current_user is a helper method (RESTful authentication) and it is apparently not available in the model (where the setter method is located). I tried.. [code=]@current_user = User.find(params[:user_id]) @contact = @current_user.contacts.find (etc)[/code] .. but the params hash too is not available. How can I scope the query through the current_user in the model file?
on 2008-10-11 11:16
on 2008-10-13 12:58
anyone got any ideas? i really need a solution for this to get a feature working.