View .rubocop.yml
AllCops: | |
TargetRubyVersion: '2.5' | |
Exclude: | |
- 'cache/**/*' | |
- 'bin/*' | |
- 'db/**/*' | |
- 'test/test_helper.rb' | |
- '*.gemspec' | |
Documentation: |
View input_collection.rb
require 'formular/elements' | |
class InputCollection < Input | |
set_default :include_hidden, true | |
html do |element| | |
concat element.collection.map { |item| | |
item.to_html(context: :default) | |
}.join('') | |
concat element.hidden_tag | |
end |
View ember-power-select.scss
// Variables | |
// Backgrounds | |
$ember-power-select-background-color: #ffffff !default; | |
$ember-power-select-disabled-background-color: #eeeeee !default; | |
$ember-power-select-multiple-selection-background-color: $gray-200 !default; | |
$ember-power-select-highlighted-background: $blue !default; | |
$ember-power-select-selected-background: $gray-200 !default; | |
// Texts |
View image_representer.rb
require 'image/persistence' | |
class Image | |
class Representer < Roar::Decorator | |
include Roar::JSON::JSONAPI.resource :images | |
# top-level link. | |
link :self, toplevel: true do | |
"//images" | |
end | |
attributes do |
View Example 1
class FieldForm < Reform::Form | |
property :key | |
collection :field_options, form: FieldOptionForm | |
validation do | |
configure do | |
option :form # include this line if you want access to your form in predicates | |
config.messages_file = 'config/error_messages.yml' # if you define any custom predicates you must provide a message for them | |
View _form.html.erb
#views/users/_form.html.erb | |
<%= simple_form_for @form do |f| %> | |
<%= f.error_notification %> | |
<%= f.input :name %> | |
<%= f.input :email %> | |
<h4> | |
<%= link_to_add_fields icon(:plus), |
View error_messages.yml
en: | |
errors: | |
rules: | |
title: | |
filled?: "can't be blank" | |
first_name: | |
filled?: "can't be blank" | |
last_name: | |
filled?: "can't be blank" | |
email: |