module Form module Component class Button < Base def attributes { :value => text, :type => :submit }.merge(options) end def text scopes = [ [:form, :buttons, form.base_name, name].flatten.compact.join(".").to_sym, :"form.buttons.#{name}", humanize(name) ].compact options.fetch :text, t(scopes.shift, default: scopes) end def to_html Tag.new(:input, attributes).to_s end end end end