diff --git a/vendor/built_in_modules/gprs/app/controllers/panel/gprs/back_end/locations_controller.rb b/vendor/built_in_modules/gprs/app/controllers/panel/gprs/back_end/locations_controller.rb index 1aff6223..3a5a6ea4 100644 --- a/vendor/built_in_modules/gprs/app/controllers/panel/gprs/back_end/locations_controller.rb +++ b/vendor/built_in_modules/gprs/app/controllers/panel/gprs/back_end/locations_controller.rb @@ -1,10 +1,10 @@ class Panel::Gprs::BackEnd::LocationsController < OrbitBackendController - before_filter :clean_values, :only => [:create, :update] + #before_filter :clean_values, :only => [:create, :update] before_filter :force_order_for_visitor,:only => [:index, :new, :edit, :delete] before_filter :force_order_for_user,:except => :get_locations - before_filter :for_app_sub_manager,:except => [:index, :new, :edit, :delete, :get_locations] + #before_filter :for_app_sub_manager,:except => [:index, :new, :edit, :delete, :get_locations] def index @locations = Location.all @@ -28,7 +28,7 @@ class Panel::Gprs::BackEnd::LocationsController < OrbitBackendController end def show - @location = Location..find(params[:id]) + @location = Location.find(params[:id]) respond_to do |format| format.html format.json { render json: @location } @@ -36,22 +36,22 @@ class Panel::Gprs::BackEnd::LocationsController < OrbitBackendController end def create - debugger @location = Location.new(params[:location]) - if @location.save - format.html { redirect_to @location } - format.json { render json: @location, status: :created, location: @location } - end - #render :action => "new" + @location.save! + redirect_to panel_gprs_back_end_locations_url + end + + def update + @location = Location.find(params[:id]) + @location.update_attributes(params[:location]) + redirect_to panel_gprs_back_end_locations_url end def destroy - @location = Location..find(params[:id]) + @location = Location.find(params[:id]) @location.destroy + redirect_to panel_gprs_back_end_locations_url - respond_to do |format| - format.json { head :no_content } - end end def get_locations diff --git a/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/_form.html.erb b/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/_form.html.erb index efda0d9e..62e8b21b 100644 --- a/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/_form.html.erb +++ b/vendor/built_in_modules/gprs/app/views/panel/gprs/back_end/locations/_form.html.erb @@ -1,4 +1,3 @@ -<%= form_for @location, :url => 'panel_gprs_back_end_locations_path' ,:class=>"form-horizontal" do |f| %>