Hi all,

I too have same problem.
Problem: I am getting "successfully stored." alert message, but getting
"null" value in suceeding alert message. whether as expected data is
{"id" => "xx"}


the code is as follows
----------------controller code------------------------
 @tmp = {}
    @tmp[:id] = "xx"

    respond_with do |format|
      format.html{ render :json => @tmp }
      format.js
    end


-----------------javascript----------------------------
$.ajax({
                    url: image.saveUrl,
                    type: 'POST',
                    data: form.serialize(),
                    error: function(e) {
                        alert("An error occured saving that note.")
                    },
                    success: function(data, status, req) {
                        alert(" successfully stored.");
                        alert(data);
                    },
                    dataType: "json"
                });
            }



Can anyone help me.

Thank u,
Aashish

-- 
Posted via http://www.ruby-forum.com/.

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

Reply via email to