Skip to content

Commit 701e5ab

Browse files
authored
Merge pull request #66 from nimmolo/nimmo-input-block
Remove block parameters from input methods
2 parents d423eb5 + ef1f77e commit 701e5ab

3 files changed

Lines changed: 40 additions & 35 deletions

File tree

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ GEM
9292
drb (2.2.1)
9393
erubi (1.13.1)
9494
ffi (1.17.1-arm64-darwin)
95+
ffi (1.17.1-x86_64-darwin)
9596
ffi (1.17.1-x86_64-linux-gnu)
9697
formatador (1.1.0)
9798
globalid (1.2.1)
@@ -146,6 +147,8 @@ GEM
146147
nio4r (2.7.4)
147148
nokogiri (1.18.9-arm64-darwin)
148149
racc (~> 1.4)
150+
nokogiri (1.18.9-x86_64-darwin)
151+
racc (~> 1.4)
149152
nokogiri (1.18.9-x86_64-linux-gnu)
150153
racc (~> 1.4)
151154
notiffany (0.1.3)
@@ -233,6 +236,7 @@ GEM
233236
securerandom (0.3.1)
234237
shellany (0.0.1)
235238
sqlite3 (2.7.3-arm64-darwin)
239+
sqlite3 (2.7.3-x86_64-darwin)
236240
sqlite3 (2.7.3-x86_64-linux-gnu)
237241
stringio (3.1.1)
238242
thor (1.3.2)
@@ -252,6 +256,7 @@ PLATFORMS
252256
arm64-darwin-22
253257
arm64-darwin-23
254258
arm64-darwin-24
259+
x86_64-darwin-21
255260
x86_64-linux
256261

257262
DEPENDENCIES

lib/superform/rails/components/input.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Superform
22
module Rails
33
module Components
44
class Input < Field
5-
def view_template(&)
5+
def view_template
66
input(**attributes)
77
end
88

lib/superform/rails/field.rb

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -72,73 +72,73 @@ def human_attribute_name
7272
# field(:birthday).date
7373
# field(:secret).hidden(value: "token123")
7474
# field(:gender).radio("male", id: "user_gender_male")
75-
def text(*, **, &)
76-
input(*, **, type: :text, &)
75+
def text(*, **)
76+
input(*, **, type: :text)
7777
end
7878

79-
def hidden(*, **, &)
80-
input(*, **, type: :hidden, &)
79+
def hidden(*, **)
80+
input(*, **, type: :hidden)
8181
end
8282

83-
def password(*, **, &)
84-
input(*, **, type: :password, &)
83+
def password(*, **)
84+
input(*, **, type: :password)
8585
end
8686

87-
def email(*, **, &)
88-
input(*, **, type: :email, &)
87+
def email(*, **)
88+
input(*, **, type: :email)
8989
end
9090

91-
def url(*, **, &)
92-
input(*, **, type: :url, &)
91+
def url(*, **)
92+
input(*, **, type: :url)
9393
end
9494

95-
def tel(*, **, &)
96-
input(*, **, type: :tel, &)
95+
def tel(*, **)
96+
input(*, **, type: :tel)
9797
end
9898
alias_method :phone, :tel
9999

100-
def number(*, **, &)
101-
input(*, **, type: :number, &)
100+
def number(*, **)
101+
input(*, **, type: :number)
102102
end
103103

104-
def range(*, **, &)
105-
input(*, **, type: :range, &)
104+
def range(*, **)
105+
input(*, **, type: :range)
106106
end
107107

108-
def date(*, **, &)
109-
input(*, **, type: :date, &)
108+
def date(*, **)
109+
input(*, **, type: :date)
110110
end
111111

112-
def time(*, **, &)
113-
input(*, **, type: :time, &)
112+
def time(*, **)
113+
input(*, **, type: :time)
114114
end
115115

116-
def datetime(*, **, &)
117-
input(*, **, type: :"datetime-local", &)
116+
def datetime(*, **)
117+
input(*, **, type: :"datetime-local")
118118
end
119119

120-
def month(*, **, &)
121-
input(*, **, type: :month, &)
120+
def month(*, **)
121+
input(*, **, type: :month)
122122
end
123123

124-
def week(*, **, &)
125-
input(*, **, type: :week, &)
124+
def week(*, **)
125+
input(*, **, type: :week)
126126
end
127127

128-
def color(*, **, &)
129-
input(*, **, type: :color, &)
128+
def color(*, **)
129+
input(*, **, type: :color)
130130
end
131131

132-
def search(*, **, &)
133-
input(*, **, type: :search, &)
132+
def search(*, **)
133+
input(*, **, type: :search)
134134
end
135135

136-
def file(*, **, &)
137-
input(*, **, type: :file, &)
136+
def file(*, **)
137+
input(*, **, type: :file)
138138
end
139139

140-
def radio(value, *, **, &)
141-
input(*, **, type: :radio, value: value, &)
140+
def radio(value, *, **)
141+
input(*, **, type: :radio, value: value)
142142
end
143143

144144
# Rails compatibility aliases

0 commit comments

Comments
 (0)