Why is my log showing a partial rendered twice Rails?

You are calling render 'greeting_form twice in your new.js. Erb If you look into the output . Js file in your browser you will see that the partial appears twice.

You are calling render 'greeting_form' twice in your new.js.erb. If you look into the output . Js file in your browser you will see that the partial appears twice.

The browser will later evaluate your javascript if-clause and use either the first or the second of the pre-rendered "greeting_form" partials. You can avoid parsing it twice by assigning the render result to a variable and then use this variable within the if or else part: var greeting_form = " @user, :greeting => @greeting) %>"; if($('#boxGreeting'). Length == 0) { $('#buttons').

After($(greeting_form). FadeIn('fast')); } else { $('#boxGreeting'). ReplaceWith(greeting_form); }.

You are a rock star. Thanks for clearing that up it works perfectly. – chell Sep 30 at 1:56.

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