Skip to content

Commit

Permalink
Add bootstrap-datepicker
Browse files Browse the repository at this point in the history
  • Loading branch information
veelenga committed Oct 12, 2016
1 parent 639e3da commit bf23d76
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ gem 'jbuilder', '~> 2.5'
gem 'slim-rails'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'bootstrap_form'
gem 'bootstrap-datepicker-rails'
gem 'paperclip'

group :development, :test do
Expand Down
5 changes: 4 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ GEM
arel (7.1.4)
autoprefixer-rails (6.5.0.2)
execjs
bootstrap-datepicker-rails (1.6.4.1)
railties (>= 3.0)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
Expand Down Expand Up @@ -239,6 +241,7 @@ PLATFORMS
ruby

DEPENDENCIES
bootstrap-datepicker-rails
bootstrap-sass (~> 3.3.6)
bootstrap_form
byebug
Expand Down Expand Up @@ -269,4 +272,4 @@ RUBY VERSION
ruby 2.3.1p112

BUNDLED WITH
1.13.2
1.13.3
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require bootstrap-datepicker
//= require turbolinks
//= require_tree .
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "bootstrap-sprockets";
@import "bootstrap";
@import "rails_bootstrap_forms";
@import "bootstrap-datepicker3"
13 changes: 10 additions & 3 deletions app/views/tournaments/_form.html.slim
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
= bootstrap_form_for @tournament, layout: :horizontal, label_col: 'col-sm-2', control_col: 'col-sm-10' do |f|
= f.text_field :no
= f.text_field :description
= f.text_field :date
= f.number_field :no, control_col: 'col-sm-2'
= f.text_area :description, rows: 8
= f.text_field :date, class: 'datepicker', control_col: 'col-sm-2', icon: 'th'
= f.form_group do
= f.submit :class => 'btn btn-primary'
= link_to t('.cancel', default: t('helpers.links.cancel')), tournaments_path, class: 'btn'

javascript:
$('.datepicker').datepicker({
autoclose: true,
todayHighlight: true,
format: 'yyyy-mm-dd'
});
2 changes: 1 addition & 1 deletion db/migrate/20161010115402_create_tournaments_and_groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class CreateTournamentsAndGroups < ActiveRecord::Migration[5.0]
def change
create_table :tournaments do |t|
t.integer :no
t.string :description
t.text :description
t.date :date

t.timestamps
Expand Down

0 comments on commit bf23d76

Please sign in to comment.