Skip to content

Instantly share code, notes, and snippets.

@antulik
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antulik/0d7426df5770e466f288 to your computer and use it in GitHub Desktop.
Save antulik/0d7426df5770e466f288 to your computer and use it in GitHub Desktop.
render_js
def show
render_js do
if result[:error]
messenger_error(message: result[:error][:message])
else
messenger_success(message: 'Your message was sent successfully')
end
hide_modal
end
end
Messenger().post({
"message":"Your message was sent successfully",
"type":"success",
"showCloseButton":true
});
$('#modal').modal('hide');
<% if result[:error] %>
Messenger().post({
"message":result[:error][:message],
"type":"error",
"showCloseButton":true
});
<% else %>
Messenger().post({
"message":"Your message was sent successfully",
"type":"success",
"showCloseButton":true
});
<% end %>
$('#modal').modal('hide');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment