Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include meaningful error messages #50

Open
slhck opened this issue Jul 2, 2012 · 0 comments
Open

Include meaningful error messages #50

slhck opened this issue Jul 2, 2012 · 0 comments

Comments

@slhck
Copy link
Member

slhck commented Jul 2, 2012

At this point, maphub does not use error messages at all. Basically, an error would either cause the application to just show the error screen, or in the case of AJAX operations, cause the page to … well, do nothing.

For example, if creating an annotation fails in the controller, it just won't submit the dialog.

Instead, we should include more meaningful error messages. Like those Bootstrap offers:

The only problem is that Rails itself uses a slightly different syntax for errors. The solution would be similar to the one explained here:

For CSS styling with Twitter Bootstrap, create a partial for flash messages in app/views/layouts/_messages.html.erb like this:

<% flash.each do |name, msg| %>
  <div class="alert alert-<%= name == :notice ? "success" : "error" %>">
    <a class="close" data-dismiss="alert">&#215;</a>
    <%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
  </div>
<% end %>

I have yet to figure out how to send error messages properly via AJAX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant