From 065389dfa4575c3c3ad51ce3f0be329c40cc6f7a Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 25 Aug 2013 20:07:57 +0200 Subject: [PATCH] datepicker --- app/inputs/datepicker_input.rb | 6 ++++++ app/views/calentries/_form.html.erb | 5 +++-- app/views/neuigkeiten/_form.html.erb | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 app/inputs/datepicker_input.rb diff --git a/app/inputs/datepicker_input.rb b/app/inputs/datepicker_input.rb new file mode 100644 index 0000000..e91e71c --- /dev/null +++ b/app/inputs/datepicker_input.rb @@ -0,0 +1,6 @@ +class DatepickerInput < FormtasticBootstrap::Inputs::StringInput + def input_html_options + super.merge(:class => "datepicker") + end + +end diff --git a/app/views/calentries/_form.html.erb b/app/views/calentries/_form.html.erb index eb9bb02..f82c63b 100644 --- a/app/views/calentries/_form.html.erb +++ b/app/views/calentries/_form.html.erb @@ -6,7 +6,7 @@ <%= f.input :start , :as => :date_string %>
- <%= f.input :ende , :as => :date_string %> + <%= f.input :ende , :as => :datepicker %>
@@ -23,7 +23,7 @@
<% end %> -
+
<%= f.actions do %> <%= f.action :submit, :as => :input %> @@ -32,3 +32,4 @@
<% end %>
+ diff --git a/app/views/neuigkeiten/_form.html.erb b/app/views/neuigkeiten/_form.html.erb index 347cfdd..2c91a2e 100755 --- a/app/views/neuigkeiten/_form.html.erb +++ b/app/views/neuigkeiten/_form.html.erb @@ -3,7 +3,7 @@ <%= f.inputs do %> <%= f.input :title, :placeholder=>"Titel" %> <%= f.input :text, :as=>:tinymce_text %> - <% f.input :datum %> + <% f.input :datum, :as=>:datepicker %> <%= f.input :rubrik, :as=>:radio, :collection=>Rubrik.all %> <%= f.input :author, :as=>:radio %> <%= f.input :picture, :as=>:file %> @@ -13,4 +13,5 @@ <%= f.action :submit, :as => :input %> <% end %> <% end %> + <%= tinymce %>