From 5f7bad1004544f748e13c436ccbad2a90829d3b0 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 10 Aug 2013 14:27:15 +0200 Subject: [PATCH] Date-String Input angelegt --- app/inputs/date_string_input.rb | 6 ++++++ app/views/calentries/_form.html.erb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 app/inputs/date_string_input.rb diff --git a/app/inputs/date_string_input.rb b/app/inputs/date_string_input.rb new file mode 100644 index 0000000..d10e2c9 --- /dev/null +++ b/app/inputs/date_string_input.rb @@ -0,0 +1,6 @@ +class DateStringInput < FormtasticBootstrap::Inputs::StringInput + def input_html_options + super.merge(:class => "datetext", :onclick =>"beep", :value=>I18n.l(@object.send(method.to_sym))) + end + +end diff --git a/app/views/calentries/_form.html.erb b/app/views/calentries/_form.html.erb index 6dd64ad..5306d58 100644 --- a/app/views/calentries/_form.html.erb +++ b/app/views/calentries/_form.html.erb @@ -1,6 +1,6 @@ <%= semantic_form_for @calentry do |f| %> <%= f.inputs do %> - <%= f.input :start %> + <%= f.input :start , :as => :date_string %> <%= f.input :ende %> <%= f.input :summary %> <%= f.input :calendar, :as=> :radio %>