Sha256: 6c248ee75f77f1887742f0882896a794bb6cb451db02284904f170a8cce11f7d

Contents?: true

Size: 1.58 KB

Versions: 5

Compression:

Stored size: 1.58 KB

Contents

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

  <title>Form Handling</title>

  <style type="text/css" media="screen">

  </style>

  <script src="../../vendor/jquery-1.4.1.min.js" type="text/javascript" charset="utf-8"></script>
  <script src="../../lib/sammy.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript" charset="utf-8">
    // ;(function($) {
      var app = new Sammy.Application(function() { with(this) {
        debug = true;
        element_selector = '#main';
        form_fields = null;

        get('#/', function() { with(this) {
          $element().text('Click form!');
        }});

        get('#/form', function() { with(this) {
          partial('files/form.html');
        }});

        post('#/pretend/post/url', function() { with(this) {
          form_fields = params;
          redirect('#/display');
        }});

        get('#/display', function() { with(this) {
          if (form_fields) {
            $element().html(form_fields.toHTML());
          } else {
            redirect('#/form')
          }
        }});

      }});

      $(function() {
        app.run('#/');
      });

    // })(jQuery);
  </script>

</head>

<body>
  <div id="container">
    <div id="main">
    </div>
    <ul id="link">
      <li><a href="#/form">Form!</a></li>
      <li><a href="#/">Back</a></li>
    </ul>
  </div>
</body>
</html>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jim-0.3.3 test/fixtures/sammy-0.5.0/examples/form_handling/index.html
jim-0.3.2 test/fixtures/sammy-0.5.0/examples/form_handling/index.html
jim-0.3.1 test/fixtures/sammy-0.5.0/examples/form_handling/index.html
jim-0.3.0 test/fixtures/sammy-0.5.0/examples/form_handling/index.html
jim-0.3.0.pre test/fixtures/sammy-0.5.0/examples/form_handling/index.html