I used extjs and ror,this is the part of my ror code:
def create
@enterprise = Enterprise.new(@params[:enterprise])
p @enterprise
if @enterprise.save
flash[:note] = ''Enterprise unit was successfully
created.''
p "michael"
redirect_to(:action=>index)
else
p "error"
render_action ''new''
end
p ''end''
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---