Sunday, April 15, 2012

Re: [Rails] ajax:success seems not respond.

Just a wild guess, but are you returning valid json from the server?
I've seen that when I have a syntax error in my returned json.

On Sat, Apr 14, 2012 at 6:48 AM, Mauro <mrsanna1@gmail.com> wrote:
> I have:
>
> = form_tag document_template_sessions_path, :id =>
> "document_template_session_frm", :remote => true do
>
> In the controller I have:
>
> class DocumentTemplateSessionsController < ApplicationController
>
>  def create
>    session[:document] = Hash.new
>    session[:document][:prot_n] = params[:document][:prot_n]
>    session[:document][:prot_data] = params[:document][:prot_data]
>    session[:document][:subject] = params[:document][:subject]
>
> In the .js.coffee file I have:
>
> $(document).on "click", "#document_template_session_btn", ->
>    $("#document_template_session_frm").submit()
>    $("#document_template_session_frm").on 'ajax:success', ->
>      $("#invite_frm").submit()
>
> The status after  $("#document_template_session_frm").submit() is 200 OK.
> but it seems that ajax:success is not considered because invite_frm
> submit is not called.
> I need a render call at the end of create method?
>
> --
> 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@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate