From c67b255e050d05a16d634a977529f57c6e0b4c47 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 28 Apr 2014 20:01:20 +0200 Subject: [PATCH] Fixes tracks form --- app/controllers/admin/tracks_controller.rb | 4 ++-- app/views/admin/conference/_sidebar.html.haml | 4 ++-- .../admin/tracks/{tracks_list.html.haml => index.html.haml} | 2 +- config/routes.rb | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) rename app/views/admin/tracks/{tracks_list.html.haml => index.html.haml} (75%) diff --git a/app/controllers/admin/tracks_controller.rb b/app/controllers/admin/tracks_controller.rb index c7126bdd..ea58759b 100644 --- a/app/controllers/admin/tracks_controller.rb +++ b/app/controllers/admin/tracks_controller.rb @@ -10,9 +10,9 @@ class Admin::TracksController < ApplicationController def update if @conference.update_attributes(params[:conference]) - redirect_to(admin_conference_tracks_list_path(:conference_id => @conference.short_title), :notice => 'Tracks were successfully updated.') + redirect_to(admin_conference_tracks_path(:conference_id => @conference.short_title), :notice => 'Tracks were successfully updated.') else - redirect_to(admin_conference_tracks_list_path(:conference_id => @conference.short_title), :notice => 'Tracks update failed.') + redirect_to(admin_conference_tracks_path(:conference_id => @conference.short_title), :notice => 'Tracks update failed.') end end diff --git a/app/views/admin/conference/_sidebar.html.haml b/app/views/admin/conference/_sidebar.html.haml index 196279cb..2e80d4c1 100644 --- a/app/views/admin/conference/_sidebar.html.haml +++ b/app/views/admin/conference/_sidebar.html.haml @@ -8,8 +8,8 @@ = link_to "Call for Papers", admin_conference_cfp_info_path(@conference.short_title) %li{:class=> active_nav_li(admin_conference_rooms_path(@conference.short_title))} = link_to "Rooms", admin_conference_rooms_path(@conference.short_title) - %li{:class=> active_nav_li(admin_conference_tracks_list_path(@conference.short_title))} - = link_to "Tracks", admin_conference_tracks_list_path(@conference.short_title) + %li{:class=> active_nav_li(admin_conference_tracks_path(@conference.short_title))} + = link_to "Tracks", admin_conference_tracks_path(@conference.short_title) %li{:class=> active_nav_li(admin_conference_eventtype_list_path(@conference.short_title))} = link_to "Event Types", admin_conference_eventtype_list_path(@conference.short_title) %li{:class=> active_nav_li(admin_conference_difficulty_levels_path(@conference.short_title))} diff --git a/app/views/admin/tracks/tracks_list.html.haml b/app/views/admin/tracks/index.html.haml similarity index 75% rename from app/views/admin/tracks/tracks_list.html.haml rename to app/views/admin/tracks/index.html.haml index edb3485f..0dd93ea1 100644 --- a/app/views/admin/tracks/tracks_list.html.haml +++ b/app/views/admin/tracks/index.html.haml @@ -2,6 +2,6 @@ .col-md-3 = render 'admin/conference/sidebar' .col-md-9 - = semantic_form_for(@conference, :url => admin_conference_tracks_update_path(@conference.short_title)) do |f| + = semantic_form_for(@conference, :url => admin_conference_track_path(:conference_id => @conference.short_title, :id => @conference.tracks)) do |f| = dynamic_association :tracks, "Tracks", f = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/config/routes.rb b/config/routes.rb index 9174d5a2..f695e02a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -24,8 +24,6 @@ Osem::Application.routes.draw do put "/venue" => "venue#update", :as => "venue_update" get "/social_events" => "social_events#show", :as => "social_events" put "/social_events" => "social_events#update" - get "/tracks" => "tracks#show", :as => "tracks_list" - put "/tracks" => "tracks#update", :as => "tracks_update" get "/dietary_choices" => "dietchoices#show", :as => "dietary_list" put "/dietary_choices" => "dietchoices#update", :as => "dietary_update" get "/volunteers_list" => "volunteers#show" @@ -39,6 +37,7 @@ Osem::Application.routes.draw do resources :difficulty_levels, :only => [ :show, :update, :index ] resources :rooms, :only => [ :show, :update, :index ] + resources :tracks, :only => [ :show, :update, :index ] put "/questions/update_conference" => "questions#update_conference" resources :questions resources :events do