var response = <%= raw @response.to_json %>; <% if session[:mobile_view] %> window.location.href = "<%= conversations_path(conversation_id: @conversation.id) %>"; <% else %> app.flashMessages._flash(response.message, response.success); if(response.success){ $("#new_conversation").removeClass('form_do_not_clear').clearForm(); window.location.href = "<%= conversations_path(conversation_id: @conversation.id) %>"; } <% end %>