Class: RubyUIAdmin::Views::Form
- Includes:
- StructureRenderer
- Defined in:
- app/components/ruby_ui_admin/views/form.rb
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(resource:, record:, view:) ⇒ Form
constructor
A new instance of Form.
- #page_title ⇒ Object
Methods included from StructureRenderer
Methods inherited from Base
#authorized_to?, #view_template
Methods included from Translation
Methods included from PathHelpers
#attachment_url, #resource_edit_path, #resource_index_path, #resource_new_path, #resource_show_path
Constructor Details
#initialize(resource:, record:, view:) ⇒ Form
Returns a new instance of Form.
8 9 10 11 12 |
# File 'app/components/ruby_ui_admin/views/form.rb', line 8 def initialize(resource:, record:, view:) @resource = resource @record = record @view = view.to_sym end |
Instance Method Details
#content ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/components/ruby_ui_admin/views/form.rb', line 18 def content render_header render_errors_summary form(action: form_action, method: "post", enctype: form_enctype, class: "space-y-6") do hidden_method_field csrf_field render_structure(@resource.field_structure(view: @view)) render_actions end end |
#page_title ⇒ Object
14 15 16 |
# File 'app/components/ruby_ui_admin/views/form.rb', line 14 def page_title "#{title_prefix} ยท #{RubyUIAdmin.configuration.app_name}" end |