diff options
| author | Marc Florisson | 2012-05-16 18:04:48 +0200 |
|---|---|---|
| committer | Marc Florisson | 2012-05-16 18:04:48 +0200 |
| commit | f420c660705a524ac7e61afaf684330ebafcd4b9 (patch) | |
| tree | c18e9e754631e89139bef468fc0d79bec35a8825 /app/controllers/stop_points_controller.rb | |
| parent | 63f7a0b5183f52b8791adf2a61521e12f652a98e (diff) | |
| parent | 12c3bf9d0e73947d34a809ce55d9a1a900f1df0f (diff) | |
| download | chouette-core-f420c660705a524ac7e61afaf684330ebafcd4b9.tar.bz2 | |
refactor stop_points
Diffstat (limited to 'app/controllers/stop_points_controller.rb')
| -rw-r--r-- | app/controllers/stop_points_controller.rb | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/app/controllers/stop_points_controller.rb b/app/controllers/stop_points_controller.rb index a5e5f2a79..ae6bbd09a 100644 --- a/app/controllers/stop_points_controller.rb +++ b/app/controllers/stop_points_controller.rb @@ -9,20 +9,18 @@ class StopPointsController < ChouetteController end end - def index - index! - end - - def create - create! do |success, failure| - success.html { redirect_to referential_line_route_path(@referential,@line,@route) } - end - end - + alias_method :route, :parent def sort - parent.reorder!( params[:stop_point]) - render :nothing => true + begin + route.reorder!( params[:stop_point]) + flash[:notice] = t("stop_points.reorder_success") + rescue => e + flash[:alert] = t("stop_points.reorder_failure") + end + respond_to do |format| + format.html { redirect_to referential_line_route_stop_points_path(@referential,@line,@route) } + end end end |
