%div.hero-unit %h1= @title %p= @plugin.meta[:description] %div %p#fields - @plugin.fields.values.sort{|a,b| a[:index] <=> b[:index] }.each do |field| %div %label.text #{field[:name]} %input{:type => :text, :size => 40, :value => field[:default], :class => "field", :name => field[:name]} %div %button.btn.btn-primary.btn-large#btn_submit Run » - if @plugin.get :callback %p %h2 return value %input#return_value{:type => :text, :readonly => true} %h2 code %div#code %pre - content_for :foot_script do :javascript var post_data = function(){ _post_data = {}; var fields = $('.field'); for(var i = 0; i < fields.length; i++){ var field = fields[i]; _post_data[field.name] = field.value; } return _post_data; }; var show_sample_code = function(){ var code = []; code.push(''); code.push('