aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/stop_points_controller.rb
diff options
context:
space:
mode:
authorMarc Florisson2012-05-16 18:04:48 +0200
committerMarc Florisson2012-05-16 18:04:48 +0200
commitf420c660705a524ac7e61afaf684330ebafcd4b9 (patch)
treec18e9e754631e89139bef468fc0d79bec35a8825 /app/controllers/stop_points_controller.rb
parent63f7a0b5183f52b8791adf2a61521e12f652a98e (diff)
parent12c3bf9d0e73947d34a809ce55d9a1a900f1df0f (diff)
downloadchouette-core-f420c660705a524ac7e61afaf684330ebafcd4b9.tar.bz2
refactor stop_points
Diffstat (limited to 'app/controllers/stop_points_controller.rb')
-rw-r--r--app/controllers/stop_points_controller.rb22
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