diff --git a/docs/3.0/avo-2-avo-3-upgrade.md b/docs/3.0/avo-2-avo-3-upgrade.md index 2ccbd3a5..4502d268 100644 --- a/docs/3.0/avo-2-avo-3-upgrade.md +++ b/docs/3.0/avo-2-avo-3-upgrade.md @@ -619,8 +619,8 @@ In Avo 3 you'll be able to insert resource tools in-between fields, tabs and pan # Before class Avo::Resources::User < Avo::BaseResource def fields - field :id, as: :id, link_to_resource: true, sortable: false - field :email, as: :gravatar, link_to_resource: true, as_avatar: :circle, only_on: :index + field :id, as: :id, link_to_record: true, sortable: false + field :email, as: :gravatar, link_to_record: true, as_avatar: :circle, only_on: :index end tool Avo::ResourceTools::UserTool @@ -629,8 +629,8 @@ end # After class Avo::Resources::User < Avo::BaseResource def fields - field :id, as: :id, link_to_resource: true, sortable: false - field :email, as: :gravatar, link_to_resource: true, as_avatar: :circle, only_on: :index + field :id, as: :id, link_to_record: true, sortable: false + field :email, as: :gravatar, link_to_record: true, as_avatar: :circle, only_on: :index tool Avo::ResourceTools::UserTool end diff --git a/docs/3.0/common/link_to_resource_common.md b/docs/3.0/common/link_to_record_common.md similarity index 69% rename from docs/3.0/common/link_to_resource_common.md rename to docs/3.0/common/link_to_record_common.md index 8aab7c8a..c931b715 100644 --- a/docs/3.0/common/link_to_resource_common.md +++ b/docs/3.0/common/link_to_record_common.md @@ -1,3 +1,3 @@ -:::option `link_to_resource` +:::option `link_to_record` Wraps the content into an anchor that links to the resource. ::: diff --git a/docs/3.0/custom-fields.md b/docs/3.0/custom-fields.md index 23acbf64..3e205d59 100644 --- a/docs/3.0/custom-fields.md +++ b/docs/3.0/custom-fields.md @@ -49,7 +49,7 @@ class Avo::Resources::Project < Avo::BaseResource self.title = :name def fields - field :id, as: :id, link_to_resource: true + field :id, as: :id, link_to_record: true field :progress, as: :progress_bar end end @@ -106,14 +106,14 @@ We can verify that all components have the text field code. From here there are module Avo module Fields class SuperTextField < BaseField - attr_reader :link_to_resource + attr_reader :link_to_record attr_reader :as_html attr_reader :protocol def initialize(id, **args, &block) super(id, **args, &block) - add_boolean_prop args, :link_to_resource + add_boolean_prop args, :link_to_record add_boolean_prop args, :as_html add_string_prop args, :protocol end @@ -125,14 +125,14 @@ end module Avo module Fields class TextField < BaseField - attr_reader :link_to_resource + attr_reader :link_to_record attr_reader :as_html attr_reader :protocol def initialize(id, **args, &block) super(id, **args, &block) - add_boolean_prop args, :link_to_resource + add_boolean_prop args, :link_to_record add_boolean_prop args, :as_html add_string_prop args, :protocol end @@ -189,7 +189,7 @@ class Avo::Resources::Project < Avo::BaseResource self.title = :name def fields - field :id, as: :id, link_to_resource: true + field :id, as: :id, link_to_record: true field :progress, as: :progress_bar, step: 10, display_value: true, value_suffix: "%" end end diff --git a/docs/3.0/field-options.md b/docs/3.0/field-options.md index 9805aff6..49dab1d4 100644 --- a/docs/3.0/field-options.md +++ b/docs/3.0/field-options.md @@ -262,19 +262,19 @@ field :updated_status, as: :status, failed_when: [:closed, :rejected, :failed], field :body, as: :textarea, nullable: true, null_values: ['0', '', 'null', 'nil', nil] ``` -## Link to resource +## Link to record -Sometimes, on the view, you may want a field in the table to be a link to that resource so that you don't have to scroll to the right to click on the icon. You can use `link_to_resource` to change a table cell to be a link to that resource. +Sometimes, on the view, you may want a field in the table to be a link to that resource so that you don't have to scroll to the right to click on the icon. You can use `link_to_record` to change a table cell to be a link to that record. ```ruby # for id field -field :id, as: :id, link_to_resource: true +field :id, as: :id, link_to_record: true # for text field -field :name, as: :text, link_to_resource: true +field :name, as: :text, link_to_record: true # for gravatar field -field :email, as: :gravatar, link_to_resource: true +field :email, as: :gravatar, link_to_record: true ``` As link to resource diff --git a/docs/3.0/fields/external_image.md b/docs/3.0/fields/external_image.md index 7fe8aa09..abb56d4f 100644 --- a/docs/3.0/fields/external_image.md +++ b/docs/3.0/fields/external_image.md @@ -46,7 +46,7 @@ Use any number to size the image. Use any number to set the radius value. ::: - + ## Use computed values @@ -65,7 +65,7 @@ end Another common place you could use it is in the grid `:cover` position. ```ruby -cover :logo, as: :external_image, link_to_resource: true do +cover :logo, as: :external_image, link_to_record: true do "//logo.clearbit.com/#{URI.parse(record.url).host}?size=180" rescue nil diff --git a/docs/3.0/fields/file.md b/docs/3.0/fields/file.md index 0748000b..e980adae 100644 --- a/docs/3.0/fields/file.md +++ b/docs/3.0/fields/file.md @@ -18,6 +18,6 @@ field :avatar, as: :file, is_image: true ## Options - + diff --git a/docs/3.0/fields/gravatar.md b/docs/3.0/fields/gravatar.md index 5ada060d..c5dacfe1 100644 --- a/docs/3.0/fields/gravatar.md +++ b/docs/3.0/fields/gravatar.md @@ -48,7 +48,7 @@ Set the default image if the email address was not found in Gravatar's database. Any number in pixels. Remember that the size will influence the `Index` table row height. ::: - + ## Using computed values diff --git a/docs/3.0/fields/id.md b/docs/3.0/fields/id.md index 92dc2e70..5a72f33a 100644 --- a/docs/3.0/fields/id.md +++ b/docs/3.0/fields/id.md @@ -5,7 +5,7 @@ license: community # ID -The `id` field is used to show the record's id. By default, it's visible only on the `Index` and `Show` views. That is a good field to add the `as_link_to_resource` option to make it a shortcut to the record `Show` page. +The `id` field is used to show the record's id. By default, it's visible only on the `Index` and `Show` views. That is a good field to add the `link_to_record` option to make it a shortcut to the record `Show` page. ```ruby field :id, as: :id @@ -13,5 +13,5 @@ field :id, as: :id ## Options - + diff --git a/docs/3.0/fields/text.md b/docs/3.0/fields/text.md index 78e0fd99..242d631c 100644 --- a/docs/3.0/fields/text.md +++ b/docs/3.0/fields/text.md @@ -45,7 +45,7 @@ field :email, `mailto`, `tel`, or any other string value you need to pass to it. ::: - + ## Customization diff --git a/docs/3.0/gemfile-environment-variables.md b/docs/3.0/gemfile-environment-variables.md index db739094..34e90612 100644 --- a/docs/3.0/gemfile-environment-variables.md +++ b/docs/3.0/gemfile-environment-variables.md @@ -20,7 +20,7 @@ This way `bundler` is aware of them without having to specify it in the `Gemfile bundle config set --global https://packager.dev/avo-hq/ xxx-xxx ``` - + ## 2. Export the variable before running `bundle install` diff --git a/docs/3.0/resource-sidebar.md b/docs/3.0/resource-sidebar.md index 96c75f1c..3c9b8e64 100644 --- a/docs/3.0/resource-sidebar.md +++ b/docs/3.0/resource-sidebar.md @@ -18,12 +18,12 @@ Using the `sidebar` block on a resource you may declare fields the same way you ```ruby class Avo::Resources::User < Avo::BaseResource def fields - field :id, as: :id, link_to_resource: true + field :id, as: :id, link_to_record: true field :first_name, as: :text, placeholder: "John" field :last_name, as: :text, placeholder: "Doe" sidebar do - field :email, as: :gravatar, link_to_resource: true, as_avatar: :circle, only_on: :show + field :email, as: :gravatar, link_to_record: true, as_avatar: :circle, only_on: :show field :active, as: :boolean, name: "Is active", only_on: :show end end diff --git a/docs/3.0/resources.md b/docs/3.0/resources.md index 6109b6f7..68ecebd3 100644 --- a/docs/3.0/resources.md +++ b/docs/3.0/resources.md @@ -162,7 +162,7 @@ class Avo::Resources::Post < Avo::BaseResource field :id, as: :id field :name, as: :text, required: true field :body, as: :trix, placeholder: "Add the post body here", always_show: false - field :cover_photo, as: :file, is_image: true, link_to_resource: true + field :cover_photo, as: :file, is_image: true, link_to_record: true field :is_featured, as: :boolean field :is_published, as: :boolean do @@ -201,8 +201,8 @@ class Avo::Resources::User < Avo::BaseResource self.title = :name def fields - field :id, as: :id, link_to_resource: true - field :email, as: :gravatar, link_to_resource: true, as_avatar: :circle + field :id, as: :id, link_to_record: true + field :email, as: :gravatar, link_to_record: true, as_avatar: :circle field :first_name, as: :text, required: true, placeholder: "John" field :last_name, as: :text, required: true, placeholder: "Doe" end @@ -225,7 +225,7 @@ class Avo::Resources::Team < Avo::BaseResource self.title = :name def fields - field :id, as: :id, link_to_resource: true + field :id, as: :id, link_to_record: true field :name, as: :text field :users, as: :has_many end @@ -243,7 +243,7 @@ class Avo::Resources::TeamUser < Avo::BaseResource self.title = :name def fields - field :id, as: :id, link_to_resource: true + field :id, as: :id, link_to_record: true field :name, as: :text field :projects_count, as: :number end @@ -258,7 +258,7 @@ class Avo::Resources::Team < Avo::BaseResource self.title = :name def fields - field :id, as: :id, link_to_resource: true + field :id, as: :id, link_to_record: true field :name, as: :text field :users, as: :has_many, use_resource: Avo::Resources::TeamUser end diff --git a/docs/3.0/tabs.md b/docs/3.0/tabs.md index f964f91c..e4e64376 100644 --- a/docs/3.0/tabs.md +++ b/docs/3.0/tabs.md @@ -21,7 +21,7 @@ When using the fields DSL for resources, all fields declared in the root will be ```ruby class Avo::Resources::User < Avo::BaseResource def fields - field :id, as: :id, link_to_resource: true + field :id, as: :id, link_to_record: true field :email, as: :text, name: "User Email", required: true panel name: "User information", description: "Some information about this user" do @@ -44,7 +44,7 @@ By default, only the fields declared in the root will be visible on the `Index` class Avo::Resources::User < Avo::BaseResource def fields # Only these fields will be visible on the `Index` view - field :id, as: :id, link_to_resource: true + field :id, as: :id, link_to_record: true field :email, as: :text, name: "User Email", required: true field :name, as: :text, only_on: :index do "#{record.first_name} #{record.last_name}" @@ -69,7 +69,7 @@ Tabs are a new layer of abstraction over panels. They enable you to group panels ```ruby class Avo::Resources::User < Avo::BaseResource def fields - field :id, as: :id, link_to_resource: true + field :id, as: :id, link_to_record: true field :email, as: :text, name: "User Email", required: true tabs do