diff --git a/Gemfile.lock b/Gemfile.lock index 92e3849..91ae8a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -92,6 +92,7 @@ GEM drb (2.2.1) erubi (1.13.1) ffi (1.17.1-arm64-darwin) + ffi (1.17.1-x86_64-darwin) ffi (1.17.1-x86_64-linux-gnu) formatador (1.1.0) globalid (1.2.1) @@ -146,6 +147,8 @@ GEM nio4r (2.7.4) nokogiri (1.18.9-arm64-darwin) racc (~> 1.4) + nokogiri (1.18.9-x86_64-darwin) + racc (~> 1.4) nokogiri (1.18.9-x86_64-linux-gnu) racc (~> 1.4) notiffany (0.1.3) @@ -233,6 +236,7 @@ GEM securerandom (0.3.1) shellany (0.0.1) sqlite3 (2.7.3-arm64-darwin) + sqlite3 (2.7.3-x86_64-darwin) sqlite3 (2.7.3-x86_64-linux-gnu) stringio (3.1.1) thor (1.3.2) @@ -252,6 +256,7 @@ PLATFORMS arm64-darwin-22 arm64-darwin-23 arm64-darwin-24 + x86_64-darwin-21 x86_64-linux DEPENDENCIES diff --git a/lib/superform/rails/components/input.rb b/lib/superform/rails/components/input.rb index 02e40b4..67875d7 100644 --- a/lib/superform/rails/components/input.rb +++ b/lib/superform/rails/components/input.rb @@ -2,7 +2,7 @@ module Superform module Rails module Components class Input < Field - def view_template(&) + def view_template input(**attributes) end diff --git a/lib/superform/rails/field.rb b/lib/superform/rails/field.rb index f82325f..f2453bc 100644 --- a/lib/superform/rails/field.rb +++ b/lib/superform/rails/field.rb @@ -72,73 +72,73 @@ def human_attribute_name # field(:birthday).date # field(:secret).hidden(value: "token123") # field(:gender).radio("male", id: "user_gender_male") - def text(*, **, &) - input(*, **, type: :text, &) + def text(*, **) + input(*, **, type: :text) end - def hidden(*, **, &) - input(*, **, type: :hidden, &) + def hidden(*, **) + input(*, **, type: :hidden) end - def password(*, **, &) - input(*, **, type: :password, &) + def password(*, **) + input(*, **, type: :password) end - def email(*, **, &) - input(*, **, type: :email, &) + def email(*, **) + input(*, **, type: :email) end - def url(*, **, &) - input(*, **, type: :url, &) + def url(*, **) + input(*, **, type: :url) end - def tel(*, **, &) - input(*, **, type: :tel, &) + def tel(*, **) + input(*, **, type: :tel) end alias_method :phone, :tel - def number(*, **, &) - input(*, **, type: :number, &) + def number(*, **) + input(*, **, type: :number) end - def range(*, **, &) - input(*, **, type: :range, &) + def range(*, **) + input(*, **, type: :range) end - def date(*, **, &) - input(*, **, type: :date, &) + def date(*, **) + input(*, **, type: :date) end - def time(*, **, &) - input(*, **, type: :time, &) + def time(*, **) + input(*, **, type: :time) end - def datetime(*, **, &) - input(*, **, type: :"datetime-local", &) + def datetime(*, **) + input(*, **, type: :"datetime-local") end - def month(*, **, &) - input(*, **, type: :month, &) + def month(*, **) + input(*, **, type: :month) end - def week(*, **, &) - input(*, **, type: :week, &) + def week(*, **) + input(*, **, type: :week) end - def color(*, **, &) - input(*, **, type: :color, &) + def color(*, **) + input(*, **, type: :color) end - def search(*, **, &) - input(*, **, type: :search, &) + def search(*, **) + input(*, **, type: :search) end - def file(*, **, &) - input(*, **, type: :file, &) + def file(*, **) + input(*, **, type: :file) end - def radio(value, *, **, &) - input(*, **, type: :radio, value: value, &) + def radio(value, *, **) + input(*, **, type: :radio, value: value) end # Rails compatibility aliases