I want to get my Rails3 app to respond to requests for some assets with json. For my application it would be inappropriate to send across all the information relating to a asset though, is there some way to specify fields? I know there's a way in Rails2. Here's some code:
def index
@directories = Directory.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @directories }
format.json { render :json => @directories }
end
end