aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorXinhui2017-04-26 11:12:11 +0200
committerXinhui2017-04-26 11:12:11 +0200
commit4799bda60096cc3b09bf449a4b766ee4778d09f7 (patch)
tree0fb3d84242f937c77451127fe2b41d4720e7c4d7 /app
parentb28038e7895be940c667f2ca29cfc3212d1aba79 (diff)
downloadchouette-core-4799bda60096cc3b09bf449a4b766ee4778d09f7.tar.bz2
Wip timetables#update state
Refs #2899
Diffstat (limited to 'app')
-rw-r--r--app/controllers/time_tables_controller.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb
index b23345607..2775316e0 100644
--- a/app/controllers/time_tables_controller.rb
+++ b/app/controllers/time_tables_controller.rb
@@ -57,9 +57,11 @@ class TimeTablesController < ChouetteController
end
def update
- @time_table = Chouette::TimeTable.find_by_id(params[:id])
- @time_table.calendar_id = nil
- update!
+ state = JSON.parse request.raw_post
+
+ respond_to do |format|
+ format.json { render json: state, status: state['errors'] ? :unprocessable_entity : :ok }
+ end
end
def index