rails_bootstrap_form 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1487 -21
- data/demo/app/controllers/users_controller.rb +7 -0
- data/demo/app/models/user.rb +1 -1
- data/demo/config/locales/en.rb +6 -0
- data/demo/db/migrate/20230528041919_add_columns_in_users.rb +11 -0
- data/demo/db/schema.rb +8 -1
- data/lib/rails_bootstrap_form/helpers/labels.rb +3 -3
- data/lib/rails_bootstrap_form/inputs/base.rb +1 -1
- data/lib/rails_bootstrap_form/inputs/collection_check_boxes.rb +1 -1
- data/lib/rails_bootstrap_form/inputs/collection_radio_buttons.rb +1 -1
- data/lib/rails_bootstrap_form/version.rb +1 -1
- metadata +3 -2
@@ -53,6 +53,13 @@ class UsersController < ApplicationController
|
|
53
53
|
:blog_url,
|
54
54
|
:fruit_id,
|
55
55
|
:favorite_color,
|
56
|
+
:username,
|
57
|
+
:expected_ctc,
|
58
|
+
:interview_date,
|
59
|
+
:interview_time,
|
60
|
+
:interview_datetime,
|
61
|
+
:weekly_off,
|
62
|
+
:gender,
|
56
63
|
skill_ids: [],
|
57
64
|
address_attributes: [
|
58
65
|
:street,
|
data/demo/app/models/user.rb
CHANGED
data/demo/config/locales/en.rb
CHANGED
@@ -29,6 +29,12 @@
|
|
29
29
|
skill_ids: "Skills",
|
30
30
|
username: "Username",
|
31
31
|
remember_me: "Keep me signed in",
|
32
|
+
expected_ctc: "Expected CTC",
|
33
|
+
interview_date: "Interview date",
|
34
|
+
interview_time: "Interview time",
|
35
|
+
interview_datetime: "Interview date & time",
|
36
|
+
weekly_off: "Week off",
|
37
|
+
gender: "Gender",
|
32
38
|
},
|
33
39
|
user_skill: {
|
34
40
|
user_id: "User",
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class AddColumnsInUsers < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
add_column :users, :username, :string
|
4
|
+
add_column :users, :expected_ctc, :float
|
5
|
+
add_column :users, :interview_date, :date
|
6
|
+
add_column :users, :interview_time, :time
|
7
|
+
add_column :users, :interview_datetime, :datetime
|
8
|
+
add_column :users, :weekly_off, :string
|
9
|
+
add_column :users, :gender, :string
|
10
|
+
end
|
11
|
+
end
|
data/demo/db/schema.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema[7.0].define(version:
|
13
|
+
ActiveRecord::Schema[7.0].define(version: 2023_05_28_041919) do
|
14
14
|
# These are extensions that must be enabled in order to support this database
|
15
15
|
enable_extension "plpgsql"
|
16
16
|
|
@@ -74,6 +74,13 @@ ActiveRecord::Schema[7.0].define(version: 2023_05_16_044126) do
|
|
74
74
|
t.string "favorite_color"
|
75
75
|
t.datetime "created_at", null: false
|
76
76
|
t.datetime "updated_at", null: false
|
77
|
+
t.string "username"
|
78
|
+
t.float "expected_ctc"
|
79
|
+
t.date "interview_date"
|
80
|
+
t.time "interview_time"
|
81
|
+
t.datetime "interview_datetime"
|
82
|
+
t.string "weekly_off"
|
83
|
+
t.string "gender"
|
77
84
|
t.index ["fruit_id"], name: "index_users_on_fruit_id"
|
78
85
|
end
|
79
86
|
|
@@ -11,7 +11,7 @@ module RailsBootstrapForm
|
|
11
11
|
def draw_label(attribute, options, bootstrap_options)
|
12
12
|
unless bootstrap_options.skip_label? && !bootstrap_options.floating?
|
13
13
|
label_options = {
|
14
|
-
class: label_classes(attribute, bootstrap_options)
|
14
|
+
class: label_classes(attribute, options, bootstrap_options)
|
15
15
|
}
|
16
16
|
label_options[:for] = options[:id] if options[:id].present?
|
17
17
|
label_text = label_text(attribute, bootstrap_options)
|
@@ -20,12 +20,12 @@ module RailsBootstrapForm
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
def label_classes(attribute, bootstrap_options)
|
23
|
+
def label_classes(attribute, options, bootstrap_options)
|
24
24
|
classes = []
|
25
25
|
classes << label_layout_classes(bootstrap_options)
|
26
26
|
classes << bootstrap_options.additional_label_class
|
27
27
|
classes << bootstrap_options.hide_class if hide_class_required?(bootstrap_options)
|
28
|
-
classes << "required" if
|
28
|
+
classes << "required" if is_field_required?(attribute, options)
|
29
29
|
classes << "is-invalid" if is_invalid?(attribute)
|
30
30
|
classes.flatten.compact
|
31
31
|
end
|
@@ -21,7 +21,7 @@ module RailsBootstrapForm
|
|
21
21
|
options = {bootstrap_form: {field_class: "form-select"}}.deep_merge!(options)
|
22
22
|
|
23
23
|
field_wrapper_builder(attribute, options, html_options) do
|
24
|
-
tag.
|
24
|
+
tag.fieldset(class: control_specific_class(field_name)) do
|
25
25
|
super(attribute, options, html_options)
|
26
26
|
end
|
27
27
|
end
|
@@ -8,7 +8,7 @@ module RailsBootstrapForm
|
|
8
8
|
extend ActiveSupport::Concern
|
9
9
|
|
10
10
|
included do
|
11
|
-
def collection_check_boxes(attribute, collection, value_method, text_method, options = {}, html_options = {}
|
11
|
+
def collection_check_boxes(attribute, collection, value_method, text_method, options = {}, html_options = {})
|
12
12
|
options[:multiple] = true
|
13
13
|
|
14
14
|
inputs = ActiveSupport::SafeBuffer.new
|
@@ -8,7 +8,7 @@ module RailsBootstrapForm
|
|
8
8
|
extend ActiveSupport::Concern
|
9
9
|
|
10
10
|
included do
|
11
|
-
def collection_radio_buttons(attribute, collection, value_method, text_method, options = {}, html_options = {}
|
11
|
+
def collection_radio_buttons(attribute, collection, value_method, text_method, options = {}, html_options = {})
|
12
12
|
inputs = ActiveSupport::SafeBuffer.new
|
13
13
|
|
14
14
|
collection.each do |object|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_bootstrap_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harshal LADHE (shivam091)
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: generator_spec
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- demo/db/migrate/20230514060556_create_skills.rb
|
130
130
|
- demo/db/migrate/20230514061100_create_user_skills.rb
|
131
131
|
- demo/db/migrate/20230516044126_create_cities.rb
|
132
|
+
- demo/db/migrate/20230528041919_add_columns_in_users.rb
|
132
133
|
- demo/db/schema.rb
|
133
134
|
- demo/db/seeds.rb
|
134
135
|
- demo/public/favicon.ico
|