Permalink
Browse files

Revert "fixed datetime rendering and submission"

This reverts commit f5f4d46.
  • Loading branch information...
1 parent 3db67c8 commit 2b8d0e8d2a33b16fed6c1d2aeeb3119187897271 Sam Harnack committed Apr 11, 2012
Showing with 11 additions and 9 deletions.
  1. +11 −9 lib/formtastic-bootstrap/inputs/base/timeish.rb
@@ -4,20 +4,22 @@ module Base
module Timeish
def date_input_html
- default_date_fragments.map do |fragment|
- fragment_input_html(fragment, "small")
- end.join.html_safe
+ fragment_input_html(:date, "small")
end
def time_input_html
- time_fragments.map do |fragment|
- fragment_input_html(fragment, "mini")
- end.join.html_safe
+ fragment_input_html(:time, "mini")
end
-
+
+ def fragment_id(fragment)
+ # TODO is this right?
+ # "#{input_html_options[:id]}_#{position(fragment)}i"
+ "#{input_html_options[:id]}[#{fragment}]"
+ end
+
def fragment_input_html(fragment, klass)
- opts = input_options.merge(:prefix => fragment_prefix, :field_name => fragment_name(fragment), :default => value, :include_blank => include_blank?)
- template.send(:"select_#{fragment}", value, opts, input_html_options.merge(:id => fragment_id(fragment), :class => klass))
+ opts = input_options.merge(:prefix => object_name, :field_name => fragment_name(fragment), :default => value, :include_blank => include_blank?)
+ template.send(:"text_field_#{fragment}", value, opts, input_html_options.merge(:id => fragment_id(fragment), :class => klass))
end
end

0 comments on commit 2b8d0e8

Please sign in to comment.