Errors

Description

Easy display of form validation errors of Rails objects

PRO
This component is part of our professional component suite. See the installation instructions below for more on how to use it.

Arguments

Name Default Type Description
html_attributes {} Hash Any attributes for the used html wrapper tag

Examples

Default

<% user = User.new
   user.save %>

<%= render Railsboot::ErrorsComponent.new(user) %>
<div class="alert alert-danger" role="alert">
  <h4 class="alert-heading">
    3 errors prevent this from saving.
  </h4>
  <ul>
    <li>Password can't be blank</li>
    <li>Email can't be blank</li>
    <li>Email is invalid</li>
  </ul>
</div>

Installation

Simply download this component with all its related files and assets. Unpackage the downloaded ZIP-file, copy all relevant files into your app and adapt the things you need. The ZIP-folder contains:

  • A parent component class (app/components/railsboot/component.rb) of which all components inherit from.
  • A base component class (app/components/railsboot/base_component.rb) which is used for rendering internally.
  • The desired component itself (app/components/railsboot/errors_component.rb).
  • A view template (app/components/railsboot/errors_component.html.erb) for the component unless it's rendered inline.
  • Any other dependent components such as Slots (just if the component needs those)
  • Any dependent assets (JS-Files, CSS-Files) (just if the component needs those)
  • A test file for the components (test/components/railsboot/errors_component_test.rb) including potential slot or dependency tests.

For more information please refer to the installation section.

Download

Download the component and its related files (e.g. templates, assets, slots etc.), unpackage the zip file and adapt the things you need.

Get access You need to purchase a professional license to download this component.