I want to display various JS alerts all in a row. Below is an example of what I want:
def exec
render :js => "alert('Exec function has started');" and return
if was_executed_successful?
render :js => "alert('Congratz! You're the champion');" and return
else
render :js => "alert('Loser!');" and return
end
end
The problem of the code above is that it only displays the first alert.
What can I do to display all of them?