as_json not honouring the options hash

I am new to ROR. I have been going through the article regarding

but i could not make as_json work with options hash . When i am using
as_json with options, it is not honoring the options and returning the
entire object.So a call like
render :json => {:user.as_json(:only => [:email] , :methods =>
[:getName]} does not work as expected and returns the whole user
object and disregards the :methods and :only. Can anyone suggest any
solution for this?