Sha256: 7b88c5f9425fdc6813614ba0f6e6e90d2959d624f17d30c48252aac6370706c2

Contents?: true

Size: 1.46 KB

Versions: 199

Compression:

Stored size: 1.46 KB

Contents

<%
  models = begin
    ApplicationRecord.descendants
  rescue => exception
    []
  end
%>
<div>
  <h3>Resources</h3>

  <div>The primary goal of Avo is to administer your database records. To do that Avo, uses the concept of a <strong>Resource</strong>. Each Avo <strong>Resource</strong> corresponds to a <strong>Rails Model</strong>.</div>

  <% if models.present? %>
    <div class="mt-2" data-controller="hidden-input">
      It seems you already have <%= models.count %> <%= 'model'.pluralize models.count %> in your app. You can generate resources for each one with the following commands.

      <strong class="cursor-pointer block mt-2" data-action="click->hidden-input#showContent">Generate resources 👇 (click to reveal)</strong>

      <div class="mt-2 hidden" data-hidden-input-target="content">
        <% models.each do |model| %>
          <code class="text-lg"><%= model.to_s %></code>
          <div>
            <code class="p-1 rounded bg-sky-500 text-white">bin/rails generate avo:resource <%= model.to_s %></code>
          </div>
        <% end %>
      </div>
    </div>
  <% else %>
    <div class="mt-2" data-controller="hidden-input">
      You may generate a resource using the following command:
      <br>

      <code class="p-1 rounded bg-sky-500 text-white">bin/rails generate avo:resource post</code>
    </div>
  <% end %>

  <p>
    <a href="https://docs.avohq.io/2.0/resources.html" target="_blank" title="Avo Resources documentation">Docs</a>
  </p>
</div>

Version data entries

199 entries across 199 versions & 1 rubygems

Version Path
avo-2.19.0 app/views/avo/home/_resources.html.erb
avo-2.18.1 app/views/avo/home/_resources.html.erb
avo-2.18.1.pre.1.eagerloaddirs app/views/avo/home/_resources.html.erb
avo-2.18.0 app/views/avo/home/_resources.html.erb
avo-2.17.1.pre.5.stackedlayout app/views/avo/home/_resources.html.erb
avo-2.17.1.pre.4.issue.1342 app/views/avo/home/_resources.html.erb
avo-2.17.1.pre.3 app/views/avo/home/_resources.html.erb
avo-2.17.1.pre.2.customauthorizationclients app/views/avo/home/_resources.html.erb
avo-2.17.1.pre.1.zeitwerk.eager.load.dir app/views/avo/home/_resources.html.erb
avo-2.17.0 app/views/avo/home/_resources.html.erb
avo-2.16.1.pre.1.nativefields app/views/avo/home/_resources.html.erb
avo-2.16.0 app/views/avo/home/_resources.html.erb
avo-2.15.3 app/views/avo/home/_resources.html.erb
avo-2.15.3.pre.1.data.attrs.to.sidebar.items app/views/avo/home/_resources.html.erb
avo-2.15.2 app/views/avo/home/_resources.html.erb
avo-2.15.2.pre.1 app/views/avo/home/_resources.html.erb
avo-2.15.1 app/views/avo/home/_resources.html.erb
avo-2.15.0 app/views/avo/home/_resources.html.erb
avo-2.14.3.pre.7.polytranslations1 app/views/avo/home/_resources.html.erb
avo-2.14.3.pre.6.nosprockets app/views/avo/home/_resources.html.erb