Sha256: 0b246d04f5a845c3c1cb221cd26b7c968fe001065c0b33fafcbfe038024e4a85

Contents?: true

Size: 630 Bytes

Versions: 2

Compression:

Stored size: 630 Bytes

Contents

class Avo::Resources::<%= resource_class %> < <%= parent_resource %><% if options["array"] %>
  def records
    [
      {
        id: 1,
        title: "Example 1"
      },
      {
        id: 2,
        title: "Example 2"
      }
    ]
  end
  <% else %>
  # self.includes = []
  # self.attachments = []<%= model_class_from_args %>
  # self.search = {
  #   query: -> { query.ransack(id_eq: params[:q], m: "or").result(distinct: false) }
  # }
  <% end %><% if options["array"] %>
  def fields
    field :id, as: :id
    field :title
  end<% else %>
  def fields
    field :id, as: :id<%= generate_fields %>
  end<% end %>
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
avo-3.16.4 lib/generators/avo/templates/resource/resource.tt
avo-3.16.3 lib/generators/avo/templates/resource/resource.tt