administrate 0.9.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/administrate/components/{has_many_form.js → associative.js} +1 -0
- data/app/assets/javascripts/administrate/components/date_time_picker.js +10 -2
- data/app/assets/javascripts/administrate/components/table.js +1 -1
- data/app/assets/stylesheets/administrate/base/_tables.scss +3 -0
- data/app/assets/stylesheets/administrate/base/_typography.scss +1 -1
- data/app/assets/stylesheets/administrate/components/_attributes.scss +1 -1
- data/app/assets/stylesheets/administrate/components/_buttons.scss +8 -0
- data/app/assets/stylesheets/administrate/components/_cells.scss +2 -0
- data/app/assets/stylesheets/administrate/components/_field-unit.scss +13 -4
- data/app/assets/stylesheets/administrate/components/_flashes.scss +0 -8
- data/app/assets/stylesheets/administrate/components/_navigation.scss +2 -3
- data/app/assets/stylesheets/administrate/library/_variables.scss +10 -8
- data/app/controllers/administrate/application_controller.rb +42 -13
- data/app/controllers/concerns/administrate/punditize.rb +3 -3
- data/app/helpers/administrate/application_helper.rb +59 -14
- data/app/views/administrate/application/_collection.html.erb +7 -6
- data/app/views/administrate/application/_flashes.html.erb +1 -1
- data/app/views/administrate/application/_form.html.erb +2 -2
- data/app/views/administrate/application/{_icons.erb → _icons.html.erb} +0 -0
- data/app/views/administrate/application/_navigation.html.erb +5 -3
- data/app/views/administrate/application/index.html.erb +2 -0
- data/app/views/administrate/application/show.html.erb +1 -1
- data/app/views/fields/belongs_to/_index.html.erb +1 -1
- data/app/views/fields/belongs_to/_show.html.erb +1 -1
- data/app/views/fields/date/_form.html.erb +24 -0
- data/app/views/fields/date/_index.html.erb +21 -0
- data/app/views/fields/date/_show.html.erb +21 -0
- data/app/views/fields/date_time/_form.html.erb +1 -1
- data/app/views/fields/date_time/_index.html.erb +1 -1
- data/app/views/fields/has_many/_form.html.erb +2 -2
- data/app/views/fields/has_many/_show.html.erb +8 -5
- data/app/views/fields/has_one/_form.html.erb +1 -1
- data/app/views/fields/password/_form.html.erb +23 -0
- data/app/views/fields/password/_index.html.erb +18 -0
- data/app/views/fields/password/_show.html.erb +18 -0
- data/app/views/fields/polymorphic/_form.html.erb +0 -3
- data/app/views/fields/select/_form.html.erb +22 -10
- data/app/views/fields/string/_show.html.erb +2 -2
- data/app/views/fields/text/_show.html.erb +2 -3
- data/app/views/fields/time/_form.html.erb +23 -0
- data/app/views/fields/time/_index.html.erb +17 -0
- data/app/views/fields/time/_show.html.erb +17 -0
- data/app/views/fields/url/_form.html.erb +23 -0
- data/app/views/fields/url/_index.html.erb +20 -0
- data/app/views/fields/url/_show.html.erb +20 -0
- data/app/views/layouts/administrate/application.html.erb +1 -1
- data/config/locales/administrate.ar.yml +2 -0
- data/config/locales/administrate.bs.yml +2 -0
- data/config/locales/administrate.ca.yml +2 -0
- data/config/locales/administrate.da.yml +2 -0
- data/config/locales/administrate.de.yml +2 -0
- data/config/locales/administrate.en.yml +2 -0
- data/config/locales/administrate.es.yml +3 -1
- data/config/locales/administrate.fr.yml +2 -0
- data/config/locales/administrate.id.yml +30 -0
- data/config/locales/administrate.it.yml +2 -0
- data/config/locales/administrate.ja.yml +4 -2
- data/config/locales/administrate.ko.yml +12 -10
- data/config/locales/administrate.nl.yml +3 -1
- data/config/locales/administrate.pl.yml +2 -0
- data/config/locales/administrate.pt-BR.yml +2 -0
- data/config/locales/administrate.pt.yml +2 -0
- data/config/locales/administrate.ru.yml +4 -2
- data/config/locales/administrate.sq.yml +30 -0
- data/config/locales/administrate.sv.yml +2 -0
- data/config/locales/administrate.uk.yml +2 -0
- data/config/locales/administrate.vi.yml +2 -0
- data/config/locales/administrate.zh-CN.yml +4 -2
- data/config/locales/administrate.zh-TW.yml +6 -4
- data/docs/adding_controllers_without_related_model.md +36 -0
- data/docs/adding_custom_field_types.md +3 -1
- data/docs/authentication.md +3 -1
- data/docs/authorization.md +5 -3
- data/docs/contributing.md +1 -0
- data/docs/customizing_attribute_partials.md +5 -2
- data/docs/customizing_controller_actions.md +32 -2
- data/docs/customizing_dashboards.md +103 -13
- data/docs/customizing_page_views.md +23 -5
- data/docs/getting_started.md +22 -51
- data/docs/rails_api.md +45 -0
- data/lib/administrate/base_dashboard.rb +33 -8
- data/lib/administrate/custom_dashboard.rb +15 -0
- data/lib/administrate/engine.rb +1 -1
- data/lib/administrate/field/associative.rb +5 -5
- data/lib/administrate/field/base.rb +13 -13
- data/lib/administrate/field/belongs_to.rb +3 -1
- data/lib/administrate/field/date.rb +20 -0
- data/lib/administrate/field/date_time.rb +1 -1
- data/lib/administrate/field/deferred.rb +19 -0
- data/lib/administrate/field/has_many.rb +16 -9
- data/lib/administrate/field/has_one.rb +7 -7
- data/lib/administrate/field/password.rb +25 -0
- data/lib/administrate/field/polymorphic.rb +6 -6
- data/lib/administrate/field/select.rb +6 -1
- data/lib/administrate/field/time.rb +8 -0
- data/lib/administrate/field/url.rb +21 -0
- data/lib/administrate/namespace.rb +5 -1
- data/lib/administrate/order.rb +17 -7
- data/lib/administrate/page/base.rb +9 -3
- data/lib/administrate/page/collection.rb +5 -1
- data/lib/administrate/page/form.rb +1 -1
- data/lib/administrate/search.rb +126 -11
- data/lib/administrate/version.rb +1 -1
- data/lib/administrate/view_generator.rb +2 -2
- data/lib/generators/administrate/dashboard/dashboard_generator.rb +19 -6
- data/lib/generators/administrate/dashboard/templates/controller.rb.erb +33 -8
- data/lib/generators/administrate/dashboard/templates/dashboard.rb.erb +18 -6
- data/lib/generators/administrate/install/templates/application_controller.rb.erb +3 -3
- data/lib/generators/administrate/routes/routes_generator.rb +18 -13
- data/lib/generators/administrate/views/layout_generator.rb +1 -0
- metadata +47 -31
- data/config/secrets.yml +0 -14
@@ -14,7 +14,7 @@ This partial renders flash messages on every page.
|
|
14
14
|
<% if flash.any? %>
|
15
15
|
<div class="flashes">
|
16
16
|
<% flash.each do |key, value| -%>
|
17
|
-
<div class="flash flash-<%= key %>"><%= value %></div>
|
17
|
+
<div class="flash flash-<%= key %>"><%= value.html_safe %></div>
|
18
18
|
<% end -%>
|
19
19
|
</div>
|
20
20
|
<% end %>
|
@@ -21,7 +21,7 @@ and renders all form fields for a resource's editable attributes.
|
|
21
21
|
<%= t(
|
22
22
|
"administrate.form.errors",
|
23
23
|
pluralized_errors: pluralize(page.resource.errors.count, t("administrate.form.error")),
|
24
|
-
resource_name: display_resource_name(page.resource_name)
|
24
|
+
resource_name: display_resource_name(page.resource_name).singularize
|
25
25
|
) %>
|
26
26
|
</h2>
|
27
27
|
|
@@ -34,7 +34,7 @@ and renders all form fields for a resource's editable attributes.
|
|
34
34
|
<% end %>
|
35
35
|
|
36
36
|
<% page.attributes.each do |attribute| -%>
|
37
|
-
<div class="field-unit field-unit--<%= attribute.html_class %>">
|
37
|
+
<div class="field-unit field-unit--<%= attribute.html_class %> field-unit--<%= requireness(attribute) %>">
|
38
38
|
<%= render_field attribute, f: f %>
|
39
39
|
</div>
|
40
40
|
<% end -%>
|
File without changes
|
@@ -8,11 +8,13 @@ as defined by the routes in the `admin/` namespace
|
|
8
8
|
%>
|
9
9
|
|
10
10
|
<nav class="navigation" role="navigation">
|
11
|
-
|
11
|
+
<%= link_to(t("administrate.navigation.back_to_app"), root_url, class: "button button--alt") if defined?(root_url) %>
|
12
|
+
|
13
|
+
<% Administrate::Namespace.new(namespace).resources_with_index_route.each do |resource| %>
|
12
14
|
<%= link_to(
|
13
15
|
display_resource_name(resource),
|
14
|
-
|
16
|
+
resource_index_route(resource),
|
15
17
|
class: "navigation__link navigation__link--#{nav_link_state(resource)}"
|
16
|
-
) %>
|
18
|
+
) if valid_action?(:index, resource) && show_action?(:index, model_from_resource(resource)) %>
|
17
19
|
<% end %>
|
18
20
|
</nav>
|
@@ -16,7 +16,7 @@ By default, the relationship is rendered as a link to the associated object.
|
|
16
16
|
%>
|
17
17
|
|
18
18
|
<% if field.data %>
|
19
|
-
<% if valid_action?(:show, field.
|
19
|
+
<% if valid_action?(:show, field.associated_class) %>
|
20
20
|
<%= link_to(
|
21
21
|
field.display_associated_resource,
|
22
22
|
[namespace, field.data],
|
@@ -16,7 +16,7 @@ By default, the relationship is rendered as a link to the associated object.
|
|
16
16
|
%>
|
17
17
|
|
18
18
|
<% if field.data %>
|
19
|
-
<% if valid_action?(:show, field.
|
19
|
+
<% if valid_action?(:show, field.associated_class) %>
|
20
20
|
<%= link_to(
|
21
21
|
field.display_associated_resource,
|
22
22
|
[namespace, field.data],
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%#
|
2
|
+
# Date Form Partial
|
3
|
+
|
4
|
+
This partial renders an input element for a date attribute.
|
5
|
+
By default, the input is a text field that is augmented with [DateTimePicker].
|
6
|
+
|
7
|
+
## Local variables:
|
8
|
+
|
9
|
+
- `f`:
|
10
|
+
A Rails form generator, used to help create the appropriate input fields.
|
11
|
+
- `field`:
|
12
|
+
An instance of [Administrate::Field::Date][1].
|
13
|
+
A wrapper around the Date value pulled from the database.
|
14
|
+
|
15
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Date
|
16
|
+
[DateTimePicker]: https://github.com/Eonasdan/bootstrap-datetimepicker
|
17
|
+
%>
|
18
|
+
|
19
|
+
<div class="field-unit__label">
|
20
|
+
<%= f.label field.attribute %>
|
21
|
+
</div>
|
22
|
+
<div class="field-unit__field">
|
23
|
+
<%= f.text_field field.attribute, data: { type: 'date' } %>
|
24
|
+
</div>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%#
|
2
|
+
# Date Index Partial
|
3
|
+
|
4
|
+
This partial renders a date attribute,
|
5
|
+
to be displayed on a resource's index page.
|
6
|
+
|
7
|
+
By default, the attribute is rendered
|
8
|
+
as a localized date string.
|
9
|
+
|
10
|
+
## Local variables:
|
11
|
+
|
12
|
+
- `field`:
|
13
|
+
An instance of [Administrate::Field::Date][1].
|
14
|
+
A wrapper around the Date value pulled from the database.
|
15
|
+
|
16
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Date
|
17
|
+
%>
|
18
|
+
|
19
|
+
<% if field.data %>
|
20
|
+
<%= field.date %>
|
21
|
+
<% end %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%#
|
2
|
+
# Date Show Partial
|
3
|
+
|
4
|
+
This partial renders a date attribute,
|
5
|
+
to be displayed on a resource's show page.
|
6
|
+
|
7
|
+
By default, the attribute is rendered
|
8
|
+
as a localized date string.
|
9
|
+
|
10
|
+
## Local variables:
|
11
|
+
|
12
|
+
- `field`:
|
13
|
+
An instance of [Administrate::Field::Date][1].
|
14
|
+
A wrapper around the Date value pulled from the database.
|
15
|
+
|
16
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Date
|
17
|
+
%>
|
18
|
+
|
19
|
+
<% if field.data %>
|
20
|
+
<%= field.date %>
|
21
|
+
<% end %>
|
@@ -20,5 +20,5 @@ By default, the input is a text field that is augmented with [DateTimePicker].
|
|
20
20
|
<%= f.label field.attribute %>
|
21
21
|
</div>
|
22
22
|
<div class="field-unit__field">
|
23
|
-
<%= f.text_field field.attribute,
|
23
|
+
<%= f.text_field field.attribute, data: { type: 'datetime' } %>
|
24
24
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%#
|
2
2
|
# HasMany Form Partial
|
3
3
|
|
4
|
-
This partial renders an input element for
|
4
|
+
This partial renders an input element for has_many relationships.
|
5
5
|
By default, the input is a collection select box
|
6
6
|
that displays all possible records to associate with.
|
7
7
|
The collection select box supports multiple inputs,
|
@@ -20,7 +20,7 @@ and is augmented with [Selectize].
|
|
20
20
|
%>
|
21
21
|
|
22
22
|
<div class="field-unit__label">
|
23
|
-
<%= f.label field.
|
23
|
+
<%= f.label field.attribute, for: "#{f.object_name}_#{field.attribute_key}" %>
|
24
24
|
</div>
|
25
25
|
<div class="field-unit__field">
|
26
26
|
<%= f.select(field.attribute_key, nil, {}, multiple: true) do %>
|
@@ -19,15 +19,18 @@ from the associated resource class's dashboard.
|
|
19
19
|
%>
|
20
20
|
|
21
21
|
<% if field.resources.any? %>
|
22
|
+
<% order = field.order_from_params(params.fetch(field.name, {})) %>
|
23
|
+
<% page_number = params.fetch(field.name, {}).fetch(:page, nil) %>
|
22
24
|
<%= render(
|
23
25
|
"collection",
|
24
|
-
collection_presenter: field.associated_collection,
|
25
|
-
|
26
|
-
|
26
|
+
collection_presenter: field.associated_collection(order),
|
27
|
+
collection_field_name: field.name,
|
28
|
+
page: page,
|
29
|
+
resources: field.resources(page_number, order),
|
30
|
+
table_title: field.name,
|
27
31
|
) %>
|
28
|
-
|
29
32
|
<% if field.more_than_limit? %>
|
30
|
-
<%= paginate field.resources(
|
33
|
+
<%= paginate field.resources(page_number), param_name: "#{field.name}[page]" %>
|
31
34
|
<% end %>
|
32
35
|
|
33
36
|
<% else %>
|
@@ -18,7 +18,7 @@ The form will be rendered as nested_from to parent relationship.
|
|
18
18
|
|
19
19
|
<%= f.fields_for field.attribute, field.data || field.nested_form.resource.class.new do |has_one_f| %>
|
20
20
|
<fieldset class="field-unit--nested">
|
21
|
-
<legend><%= field.nested_form.resource_name.titleize %></legend>
|
21
|
+
<legend><%= t "helpers.label.#{f.object_name}.#{field.nested_form.resource_name}", default: field.nested_form.resource_name.titleize %></legend>
|
22
22
|
<% field.nested_form.attributes.each do |attribute| -%>
|
23
23
|
<div class="field-unit field-unit--<%= attribute.html_class %>">
|
24
24
|
<%= render_field attribute, f: has_one_f %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%#
|
2
|
+
# Password Form Partial
|
3
|
+
|
4
|
+
This partial renders an input element for a password attribute.
|
5
|
+
By default, the input is a password field.
|
6
|
+
|
7
|
+
## Local variables:
|
8
|
+
|
9
|
+
- `f`:
|
10
|
+
A Rails form generator, used to help create the appropriate input fields.
|
11
|
+
- `field`:
|
12
|
+
An instance of [Administrate::Field::Password][1].
|
13
|
+
A wrapper around the Password.
|
14
|
+
|
15
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Password
|
16
|
+
%>
|
17
|
+
|
18
|
+
<div class="field-unit__label">
|
19
|
+
<%= f.label field.attribute %>
|
20
|
+
</div>
|
21
|
+
<div class="field-unit__field">
|
22
|
+
<%= f.password_field field.attribute, value: field.data %>
|
23
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%#
|
2
|
+
# Password Index Partial
|
3
|
+
|
4
|
+
This partial renders a password attribute
|
5
|
+
to be displayed on a resource's index page.
|
6
|
+
|
7
|
+
By default, the attribute is rendered as a truncated string.
|
8
|
+
|
9
|
+
## Local variables:
|
10
|
+
|
11
|
+
- `field`:
|
12
|
+
An instance of [Administrate::Field::Password][1].
|
13
|
+
A wrapper around the Password.
|
14
|
+
|
15
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Password
|
16
|
+
%>
|
17
|
+
|
18
|
+
<%= field.truncate %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%#
|
2
|
+
# Password Show Partial
|
3
|
+
|
4
|
+
This partial renders a password attribute,
|
5
|
+
to be displayed on a resource's show page.
|
6
|
+
|
7
|
+
By default, the attribute is rendered as an truncate string.
|
8
|
+
|
9
|
+
## Local variables:
|
10
|
+
|
11
|
+
- `field`:
|
12
|
+
An instance of [Administrate::Field::Password][1].
|
13
|
+
A wrapper around the Password.
|
14
|
+
|
15
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Password
|
16
|
+
%>
|
17
|
+
|
18
|
+
<%= field.truncate %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%#
|
2
|
-
# Select
|
2
|
+
# Select Form Partial
|
3
3
|
|
4
4
|
This partial renders a selectable text attribute,
|
5
5
|
to be displayed on a resource's edit form page.
|
@@ -19,13 +19,25 @@ to be displayed on a resource's edit form page.
|
|
19
19
|
<%= f.label field.attribute %>
|
20
20
|
</div>
|
21
21
|
<div class="field-unit__field">
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
22
|
+
<% if field.selectable_options.first&.is_a?(Array) %>
|
23
|
+
<%= f.select(
|
24
|
+
field.attribute,
|
25
|
+
options_from_collection_for_select(
|
26
|
+
field.selectable_options,
|
27
|
+
:last,
|
28
|
+
:first,
|
29
|
+
field.data.presence,
|
30
|
+
)
|
31
|
+
) %>
|
32
|
+
<% else %>
|
33
|
+
<%= f.select(
|
34
|
+
field.attribute,
|
35
|
+
options_from_collection_for_select(
|
36
|
+
field.selectable_options,
|
37
|
+
:to_s,
|
38
|
+
:to_s,
|
39
|
+
field.data.presence,
|
40
|
+
)
|
41
|
+
) %>
|
42
|
+
<% end %>
|
31
43
|
</div>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
This partial renders a string attribute,
|
5
5
|
to be displayed on a resource's show page.
|
6
6
|
|
7
|
-
By default, the attribute is rendered as
|
7
|
+
By default, the attribute is rendered as text with whitespace preserved.
|
8
8
|
|
9
9
|
## Local variables:
|
10
10
|
|
@@ -15,4 +15,4 @@ By default, the attribute is rendered as an unformatted string.
|
|
15
15
|
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/String
|
16
16
|
%>
|
17
17
|
|
18
|
-
|
18
|
+
<div class="preserve-whitespace"><%= field.data %></div>
|
@@ -4,8 +4,7 @@
|
|
4
4
|
This partial renders a text attribute,
|
5
5
|
to be displayed on a resource's show page.
|
6
6
|
|
7
|
-
By default, the attribute is rendered as text with
|
8
|
-
whitespace preserved.
|
7
|
+
By default, the attribute is rendered as text with whitespace preserved.
|
9
8
|
|
10
9
|
## Local variables:
|
11
10
|
|
@@ -16,4 +15,4 @@ whitespace preserved.
|
|
16
15
|
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Text
|
17
16
|
%>
|
18
17
|
|
19
|
-
<
|
18
|
+
<div class="preserve-whitespace"><%= field.data %></div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%#
|
2
|
+
# Time Form Partial
|
3
|
+
|
4
|
+
This partial renders an input element for time attributes.
|
5
|
+
By default, the input is a text field that is augmented with [DateTimePicker].
|
6
|
+
|
7
|
+
## Local variables:
|
8
|
+
|
9
|
+
- `f`:
|
10
|
+
A Rails form generator, used to help create the appropriate input fields.
|
11
|
+
- `field`:
|
12
|
+
An instance of [Administrate::Field::Time][1].
|
13
|
+
A wrapper around the tmie attributes pulled from the model.
|
14
|
+
|
15
|
+
[DateTimePicker]: https://github.com/Eonasdan/bootstrap-datetimepicker
|
16
|
+
%>
|
17
|
+
|
18
|
+
<div class="field-unit__label">
|
19
|
+
<%= f.label field.attribute %>
|
20
|
+
</div>
|
21
|
+
<div class="field-unit__field">
|
22
|
+
<%= f.text_field field.attribute, data: { type: 'time' }, value: field.data&.strftime("%H:%M:%S") %>
|
23
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%#
|
2
|
+
# Time Index Partial
|
3
|
+
|
4
|
+
This partial renders an time attribute
|
5
|
+
to be displayed on a resource's index page.
|
6
|
+
|
7
|
+
By default, the attribute is rendered as a text tag.
|
8
|
+
|
9
|
+
## Local variables:
|
10
|
+
|
11
|
+
- `field`:
|
12
|
+
An instance of [Administrate::Field::Time][1].
|
13
|
+
A wrapper around the time attributes pulled from the model.
|
14
|
+
|
15
|
+
%>
|
16
|
+
|
17
|
+
<%= field.data.strftime("%I:%M%p").to_s %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%#
|
2
|
+
# Time Show Partial
|
3
|
+
|
4
|
+
This partial renders an time attribute,
|
5
|
+
to be displayed on a resource's show page.
|
6
|
+
|
7
|
+
By default, the attribute is rendered as a text tag.
|
8
|
+
|
9
|
+
## Local variables:
|
10
|
+
|
11
|
+
- `field`:
|
12
|
+
An instance of [Administrate::Field::Time][1].
|
13
|
+
A wrapper around the time attributes pulled from the model.
|
14
|
+
|
15
|
+
%>
|
16
|
+
|
17
|
+
<%= field.data.strftime("%I:%M%p").to_s %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%#
|
2
|
+
# Url Form Partial
|
3
|
+
|
4
|
+
This partial renders an input element for URL.
|
5
|
+
By default, the input is a text box.
|
6
|
+
|
7
|
+
## Local variables:
|
8
|
+
|
9
|
+
- `f`:
|
10
|
+
A Rails form generator, used to help create the appropriate input fields.
|
11
|
+
- `field`:
|
12
|
+
An instance of [Administrate::Field::Url][1].
|
13
|
+
A wrapper around the URL pulled from the database.
|
14
|
+
|
15
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/Url
|
16
|
+
%>
|
17
|
+
|
18
|
+
<div class="field-unit__label">
|
19
|
+
<%= f.label field.attribute %>
|
20
|
+
</div>
|
21
|
+
<div class="field-unit__field">
|
22
|
+
<%= f.url_field field.attribute %>
|
23
|
+
</div>
|