From 5edabe13825d93247be5c42f3757ca5ce0d1c36e Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Sun, 18 Oct 2015 13:54:14 +0300 Subject: [PATCH] Add CSS class to tracks by request of @krokodilerian --- app/controllers/management/conferences_controller.rb | 3 ++- app/views/management/conferences/_form_tracks.html.slim | 1 + db/migrate/20151018105303_add_css_class_to_tracks.rb | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20151018105303_add_css_class_to_tracks.rb diff --git a/app/controllers/management/conferences_controller.rb b/app/controllers/management/conferences_controller.rb index a72b913..61a6f03 100644 --- a/app/controllers/management/conferences_controller.rb +++ b/app/controllers/management/conferences_controller.rb @@ -55,7 +55,8 @@ module Management :title, :email, :start_date, :end_date, :description, :host_name, event_types_attributes: [:id, :name, :description, :maximum_length, :minimum_length, :_destroy], - tracks_attributes: [:id, :name, :color, :description, :_destroy], + tracks_attributes: [:id, :name, :color, :css_class, :description, + :_destroy], halls_attributes: [:id, :name, :_destroy], volunteer_teams_attributes: [:id, :name, :description, :color, :_destroy] ) diff --git a/app/views/management/conferences/_form_tracks.html.slim b/app/views/management/conferences/_form_tracks.html.slim index 6dc5d96..7151918 100644 --- a/app/views/management/conferences/_form_tracks.html.slim +++ b/app/views/management/conferences/_form_tracks.html.slim @@ -10,6 +10,7 @@ div#tracks .panel-body = ff.input :name = ff.input :color, as: :color + = ff.input :css_class = ff.input :description .col-lg-6 .panel.panel-default diff --git a/db/migrate/20151018105303_add_css_class_to_tracks.rb b/db/migrate/20151018105303_add_css_class_to_tracks.rb new file mode 100644 index 0000000..f72c8cb --- /dev/null +++ b/db/migrate/20151018105303_add_css_class_to_tracks.rb @@ -0,0 +1,5 @@ +class AddCssClassToTracks < ActiveRecord::Migration + def change + add_column :tracks, :css_class, :string + end +end