-1

I have a page that contains a Java applet. The applet is in the _program.html.erb partial. Here's the simplified ERB:

    <%= render "program" %>
    <div class="buttons" style="text-align:center; margin-top: 20px">
      BUTTONS <!--this doesn't render, but it renders if I remove the applet tag in _program, below. It's not that the buttons are blocked from view - they're not in the HTML source -->
    </div>

Here's _program.html.erb:

      <applet archive="<%= program.compiled.url %>" code="<%= program.name %>" />

The applet renders, but nothing after it renders, including the ERB and HTML after it and the footer partials. The HTML before the applet tag are closed properly after the applet tag. I found that using <embed> instead of <applet> fixes it (ie things after the program render again), but does anyone know why? Specifically:

  1. Why does Rails not return any markup after the applet?
  2. Why does using <embed> work?

In addition to string.ascii_lowercase you should also take a look at the ord and chr built-ins. ord('a') will give you the ascii value for 'a' and chr(ord('a')) will give you back the string 'a'.

Using these you can increment and decrement through character codes and convert back and forth easily enough. ASCII table is always a good bookmark to have too.

4

1 に答える 1