Skip to content

Instantly share code, notes, and snippets.

@antulik antulik/controller_1.rb
Last active Aug 29, 2015

Embed
What would you like to do?
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
def show
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
You can’t perform that action at this time.