diff options
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/application_controller.rb | 1 | ||||
| -rw-r--r-- | app/controllers/referentials_controller.rb | 7 | ||||
| -rw-r--r-- | app/controllers/routes_controller.rb | 4 | ||||
| -rw-r--r-- | app/controllers/stop_areas_controller.rb | 4 | ||||
| -rw-r--r-- | app/controllers/time_tables_controller.rb | 3 | 
5 files changed, 17 insertions, 2 deletions
| diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 04dd281d5..4359ee02e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,6 +2,7 @@ class ApplicationController < ActionController::Base    protect_from_forgery    before_filter :authenticate_user!    before_filter :set_locale +  helper LanguageEngine::Engine.helpers    def set_locale      I18n.locale = session[:language] || I18n.default_locale diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index 9cf4a5f62..643c780a4 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -25,18 +25,25 @@ class ReferentialsController < BreadcrumbController    def resource      @referential ||= current_organisation.referentials.find_by_id(params[:id])    end +      def collection      @referentials ||= current_organisation.referentials.order(:name)    end +      def build_resource      super.tap do |referential|        referential.user_id = current_user.id        referential.user_name = current_user.name      end    end +      def create_resource(referential)      referential.organisation = current_organisation      super    end +  def permitted_params +    params.permit(referential: [ :name, :slug, :prefix, :time_zone, :upper_corner, :lower_corner, :organisation_id  ]) +  end   +  end diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb index 6454ce068..c74b0ade8 100644 --- a/app/controllers/routes_controller.rb +++ b/app/controllers/routes_controller.rb @@ -75,5 +75,9 @@ class RoutesController < ChouetteController        end    end +  def permitted_params +    params.require(:route).permit( :direction_code, :wayback_code, :line_id, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :opposite_route_id, :published_name, :number, :direction, :wayback, { stop_points_attributes: [ :id, :_destroy, :position, :stop_area_id ] } ) +  end   +  end diff --git a/app/controllers/stop_areas_controller.rb b/app/controllers/stop_areas_controller.rb index 6277b5814..0b816ca45 100644 --- a/app/controllers/stop_areas_controller.rb +++ b/app/controllers/stop_areas_controller.rb @@ -133,4 +133,8 @@ class StopAreasController < ChouetteController        end    end +  def permitted_params +    params.permit(stop_area: [ :routing_stop_ids, :routing_line_ids, :children_ids, :stop_area_type, :parent_id, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :zip_code, :city_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :coordinates, :url, :time_zone ]) +  end   +  end diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb index be0a3c4bd..52493987a 100644 --- a/app/controllers/time_tables_controller.rb +++ b/app/controllers/time_tables_controller.rb @@ -89,7 +89,6 @@ class TimeTablesController < ChouetteController    end    def permitted_params -    params.permit(time_table: [ :objectid, :object_version, :creation_time, :creator_id, :version, :comment, -:int_day_types, :monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday, :start_date, :end_date, :dates_attributes, :periods_attributes, :tag_list, :tag_search ] ) +    params.permit(time_table: [ :objectid, :object_version, :creation_time, :creator_id, :version, :comment, :int_day_types, :monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday, :start_date, :end_date, :dates_attributes, :periods_attributes, :tag_list, :tag_search ] )    end  end | 
