Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -252,6 +256,7 @@ PLATFORMS
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
Expand Down
2 changes: 1 addition & 1 deletion lib/superform/rails/components/input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Superform
module Rails
module Components
class Input < Field
def view_template(&)
def view_template
input(**attributes)
end

Expand Down
68 changes: 34 additions & 34 deletions lib/superform/rails/field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down