app/controllers/listings_controller.rb
def listing_params
    params \
      .fetch(:listing, {}) \
      .permit(
        :user_id, :evaluation_count, :zipcode, :location, :location_en, :longitude, :latitude, :delivery_flg, :price, :info_admin_id,
        :ave_total, :ave_accuracy, :ave_communication, :ave_cleanliness, :ave_location, :ave_check_in, :ave_cost_performance, :open,
        :description, :description_en, :title, :title_en, :capacity, :direction, :schedule, :listing_images,
        :cover_image, :cover_image_caption, :cover_video, :cover_video_caption, :smoking_id, :unit, :reservation_time_unit, :from, :to,
        :business_hours_remarks, :shop_description, :shop_description_en, :price_low, :price_high, :tel, :url, :review_url,
        :recommended, :recommended_en, :visit_benefits, :visit_benefits_en, :visit_benefits_another, :visit_benefits_another_en,
        :price_low_dinner, :price_high_dinner, :link_tabelog, :link_yelp, :link_tripadvisor, :reservation_frame, :capacity,
        listing_image_attributes: [:listing_id, :image, :order, :capacity],
        listings_shop_categories_attributes: [:id, :shop_category_id, :_destroy],
        listings_shop_services_attributes: [:id, :shop_service_id, :_destroy],
        englishes_listings_attributes: [:id, :english_id, :_destroy],
        english_messages_listings_attributes: [:id, :english_message_id, :_destroy],
        weekday_business_hours_attributes: [:id, :wday, :is_open, :start_hour, :end_hour, :lunch_break_start_hour, :lunch_break_end_hour, :has_lunch_break, :_destroy],
        holiday_business_hour_attributes: [:id, :is_open, :start_hour, :end_hour, :lunch_break_start_hour, :lunch_break_end_hour, :has_lunch_break, :_destroy]
      ) \
      .merge(user_id: current_user.id)
  end
# Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet only allow the white list through .
def listing_params
    params \
      .fetch(:listing, {}) \
      .permit(
        :user_id, :evaluation_count, :zipcode, :location, :location_en, :longitude, :latitude, :delivery_flg, :price, :info_admin_id,
        :ave_total, :ave_accuracy, :ave_communication, :ave_cleanliness, :ave_location, :ave_check_in, :ave_cost_performance, :open,
        :description, :description_en, :title, :title_en, :capacity, :direction, :schedule, :listing_images,
        :cover_image, :cover_image_caption, :cover_video, :cover_video_caption, :smoking_id, :unit, :reservation_time_unit, :from, :to,
        :business_hours_remarks, :shop_description, :shop_description_en, :price_low, :price_high, :tel, :url, :review_url,
        :recommended, :recommended_en, :visit_benefits, :visit_benefits_en, :visit_benefits_another, :visit_benefits_another_en,
        :price_low_dinner, :price_high_dinner, :link_tabelog, :link_yelp, :link_tripadvisor, :reservation_frame, :capacity,
        listing_image_attributes: [:listing_id, :image, :order, :capacity],
        listings_shop_categories_attributes: [:id, :shop_category_id, :_destroy],
        listings_shop_services_attributes: [:id, :shop_service_id, :_destroy],
        englishes_listings_attributes: [:id, :english_id, :_destroy],
        english_messages_listings_attributes: [:id, :english_message_id, :_destroy],
        weekday_business_hours_attributes: [:id, :wday, :is_open, :start_hour, :end_hour, :lunch_break_start_hour, :lunch_break_end_hour, :has_lunch_break, :_destroy],
        holiday_business_hour_attributes: [:id, :is_open, :start_hour, :end_hour, :lunch_break_start_hour, :lunch_break_end_hour, :has_lunch_break, :_destroy]
      ) \
      .merge(user_id: current_user.id)
  end
def listing_params params . fetch ( :listing , { } ) . permit ( :user_id , :evaluation_count , :zipcode , :location , :location_en , :longitude , :latitude , :delivery_flg , :price , :info_admin_id , :ave_total , :ave_accuracy , :ave_communication , :ave_cleanliness , :ave_location , :ave_check_in , :ave_cost_performance , :open , :description , :description_en , :title , :title_en , :capacity , :direction , :schedule , :listing_images , :cover_image , :cover_image_caption , :cover_video , :cover_video_caption , :smoking_id , :unit , :reservation_time_unit , :from , :to , :business_hours_remarks , :shop_description , :shop_description_en , :price_low , :price_high , :tel , :url , :review_url , :recommended , :recommended_en , :visit_benefits , :visit_benefits_en , :visit_benefits_another , :visit_benefits_another_en , :price_low_dinner , :price_high_dinner , :link_tabelog , :link_yelp , :link_tripadvisor , :reservation_frame , :capacity , listing_image_attributes : [ :listing_id , :image , :order , :capacity ] , listings_shop_categories_attributes : [ :id , :shop_category_id , :_destroy ] , listings_shop_services_attributes : [ :id , :shop_service_id , :_destroy ] , englishes_listings_attributes : [ :id , :english_id , :_destroy ] , english_messages_listings_attributes : [ :id , :english_message_id , :_destroy ] , weekday_business_hours_attributes : [ :id , :wday , :is_open , :start_hour , :end_hour , :lunch_break_start_hour , :lunch_break_end_hour , :has_lunch_break , :_destroy ] , holiday_business_hour_attributes : [ :id , :is_open , :start_hour , :end_hour , :lunch_break_start_hour , :lunch_break_end_hour , :has_lunch_break , :_destroy ] ) . merge ( user_id : current_user . id ) end
Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet only allow the white list through .