Sha256: d3bf746e1a2b272fdf603ec9114d0aa2dad0b50979e156de2b284b007a98c267

Contents?: true

Size: 1.78 KB

Versions: 1

Compression:

Stored size: 1.78 KB

Contents

<html>
  <head>
    <title>generator</title>
    <%= stylesheet_link_tag 'generator' %>
    <%= javascript_include_tag 'application' %>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <%= csrf_meta_tags %>
    <script type="text/javascript">
      $(document).on('click', '#add_attr_type', function() {
          var i = $('#attr_type input').length;
          $('#attr_type').append('<span class="new_attr"><%= escape_javascript text_field_tag('attr[@]', '') %><span class="separator">:</span><%= escape_javascript(type_select 'type[@]', :class => 'type') %></span>'.replace(/@/g, i));
          $('#attr_' + i).focus();
      })
    </script>
  </head>
  <body>
    <div id="container">
      <div id="generate">
        <h1>Generate Scaffold</h1>
        <%= form_tag scaffold_generator_path, :remote => true, :id => 'generator_form', authenticity_token: true do %>
          <h2>
            <% if @name.include? '_' %>
              g scaffold
              <%= select_tag :name, options_for_select([@name, @name.gsub('_', '/')]) %>
            <% else %>
              g scaffold <%= @name %>
              <%= hidden_field_tag :name, @name %>
            <% end %>
          </h2>
          <%= hidden_field_tag :return_path, params[:return_path] %>
          <div id="attrs">
            <div id="attr_type">
              <span class="new_attr"><%= text_field_tag 'attr[0]', '', :autofocus => true %><span class="separator">:</span><%= type_select 'type[0]', :class => 'type' %></span>
            </div>
            <input type="button" value="add attribute" id="add_attr_type">
          </div>
          <div id="action">
            <%= submit_tag 'Generate', :id => "generate_submit" %>
          </div>
        <% end %>
      </div>
    </div>
  </body>
</html>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hocus_pocus-0.4.1 engines/generator/app/views/hocus_pocus/generator/generator/index.html.erb