Sha256: 27fc2044fa8ac4b2a66c95b861bd929a4da9bb06e5947ad087053d32bc2ab2a2

Contents?: true

Size: 856 Bytes

Versions: 1

Compression:

Stored size: 856 Bytes

Contents

%form#shortener{:method=>'post',:action=>'/'}
  %input{:type=>'hidden',:name=>'_method',:value=>'put'}
  ="http://#{@env['HTTP_HOST']}/"
  %input#path.faux{:type=>'text',:name=>'path',:value=>@url.path,:tabindex=>2,:size=>8}>
  ➔
  %input#url{:type=>'text',:name=>'url',:value=>@url.url,:tabindex=>1,:size=>35}
  %input#shorten{:type=>'submit',:value=>'Shorten',:tabindex=>3}
#status
:javascript
  (function(){
    $('#shortener').submit(function(e){
      $.shorty.shorten($('#url').val(), $('#path').val(), {
        success: function(url){
          $('#status').text('Created ' + url);
          $.shorty.getKey(function(newKey){
            $('#path').val(newKey);
            $('#url').val('');
          });
        },
        error: function(error){
          $('#status').text(error);
        }
      });
      return false;
    });
  })();

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shorty_server-0.5.0 lib/shorty/ui/views/show.haml