How can I return a json packet?

I used extjs and ror,this is the part of my ror code:

def create

@enterprise =[:enterprise])

p @enterprise

flash[:note] = ‘Enterprise unit was successfully created.’
p “michael”

  p "error"
  render_action 'new'
p 'end'


but each time my explore can’t direct to another page.I ask the
extjs,here is the ansower:

Form’s submit method performs an Asynchronous submit via an Ajax
request. It looks for a success attribute in the JSON packet which is
returned by the server-side. Change the response to {success: true}
and then in your success handler redirect the page via JS.

so how can I return a json packet from ror