lib/hanami/helpers/form_helper.rb in hanami-helpers-0.3.0 vs lib/hanami/helpers/form_helper.rb in hanami-helpers-0.4.0
- old
+ new
@@ -26,26 +26,28 @@
# * Automatic selection of current value for radio button and select inputs
# * Infinite nested fields
#
# Supported tags and inputs:
#
+ # * <tt>check_box</tt>
# * <tt>color_field</tt>
# * <tt>date_field</tt>
# * <tt>datetime_field</tt>
# * <tt>datetime_local_field</tt>
# * <tt>email_field</tt>
- # * <tt>hidden_field</tt>
- # * <tt>file_field</tt>
# * <tt>fields_for</tt>
+ # * <tt>file_field</tt>
# * <tt>form_for</tt>
+ # * <tt>hidden_field</tt>
# * <tt>label</tt>
- # * <tt>text_area</tt>
- # * <tt>text_field</tt>
+ # * <tt>number_field</tt>
# * <tt>password_field</tt>
# * <tt>radio_button</tt>
# * <tt>select</tt>
# * <tt>submit</tt>
+ # * <tt>text_area</tt>
+ # * <tt>text_field</tt>
#
# @since 0.2.0
#
# @see Hanami::Helpers::FormHelper#form_for
# @see Hanami::Helpers::HtmlHelper
@@ -393,16 +395,16 @@
# #
# # <button type="submit">Create</button>
# # </form>
def form_for(name, url, options = {}, &blk)
form = if name.is_a?(Form)
- options = url
- name
- else
- Form.new(name, url, options.delete(:values))
- end
+ options = url
+ name
+ else
+ Form.new(name, url, options.delete(:values))
+ end
- attributes = { action: form.url, method: form.verb, :'accept-charset' => DEFAULT_CHARSET, id: "#{ form.name }-form" }.merge(options)
+ attributes = { action: form.url, method: form.verb, :'accept-charset' => DEFAULT_CHARSET, id: "#{form.name}-form" }.merge(options)
FormBuilder.new(form, attributes, self, &blk)
end
# Returns CSRF Protection Token stored in session.
#