Ajax post request does not update with render in ruby on rails?

Up vote 0 down vote favorite share g+ share fb share tw.

I have a form that post 2 fields to the server with the "remote => true" and I have format. Js in my controller. If I in my create.js.

Erb use object values it works fine but if I want to render a included file the js fails to do so. I have a div with an id called container that will be updated with the data. The create.js.

Erb file looks like this: $('#container').html(); My controller looks like this: def create @casepost = Casepost. New(params:casepost) respond_to do |format| if @casepost. Save @caseposts = Casepost.

All format. Html format. Js# { render json: @casepost, status: :created, location: @casepost } else @caseposts = Casepost.

All format. Html { render action: "new" } format. Js# { render json: @casepost.

Errors, status: :unprocessable_entity } end end end THe file I want to render puts out the content of an array called @caseposts. Title Body ruby-on-rails ajax render link|improve this question asked Nov 1 '11 at 9:41MattiasB277 33% accept rate.

After testing some I found out that I can't have newlines or link_to's in my code. Is Ajax crippled somehow? – MattiasB Nov 1 '11 at 12:03.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions