multiple render text in jquery rails


For one action of user based on condition i want to render different texts. So how do i achieve it through jquery? For example:

A simple posting message application:

On post button i have a post method which has security checks and other server side checks like :