lib/pakyow/presenter/presenters/form.rb in pakyow-presenter-1.0.0.rc2 vs lib/pakyow/presenter/presenters/form.rb in pakyow-presenter-1.0.0.rc3
- old
+ new
@@ -68,11 +68,11 @@
attrs[:action] = action
end
end
# Sets the form method. Automatically handles method overrides by prepending a hidden field
- # named `_method` when +method+ is not get or post, setting the form method to +post+.
+ # named `pw-http-method` when +method+ is not get or post, setting the form method to +post+.
#
def method=(method)
method = method.to_s.downcase
if method_override_required?(method)
attrs[:method] = "post"
@@ -210,11 +210,11 @@
end
def use_binding_nodes
view.object.set_label(:bound, true)
view.object.children.each_significant_node(:binding, descend: true) do |object|
- if Pakyow::Presenter::Form::FIELD_TAGS.include?(object.tagname)
+ if Pakyow::Presenter::Views::Form::FIELD_TAGS.include?(object.tagname)
object.set_label(:bound, true)
end
end
end
@@ -267,11 +267,11 @@
def method_override_required?(method)
method != "get" && method != "post"
end
def method_override_input
- html_safe("<input type=\"hidden\" name=\"_method\">")
+ html_safe("<input type=\"hidden\" name=\"pw-http-method\">")
end
def find_or_create_method_override_input
unless input = view.object.find_first_significant_node(:method_override)
prepend(method_override_input)
@@ -335,11 +335,11 @@
end
values = Array.ensure(values).compact
if values.any?
- field_view = Pakyow::Presenter::Form.from_object(field_presenter.view.object)
+ field_view = Pakyow::Presenter::Views::Form.from_object(field_presenter.view.object)
field_template = field_view.dup
insertable_field = field_view
current_field = field_view
values.each do |value|
@@ -359,10 +359,10 @@
def create_options(original_values, field_presenter)
values = Array.ensure(original_values).compact
if values.any?
- field_view = Pakyow::Presenter::Form.from_object(field_presenter.view.object)
+ field_view = Pakyow::Presenter::Views::Form.from_object(field_presenter.view.object)
template = field_view.dup
insertable = field_view
current = field_view
values.each do |value|