<commit_before>class RestaurantsController < ApplicationController
	def index
		@restaurants = Restaurant.all
	end

	def new
		@restaurant = Restaurant.new	
	end

	def create
		binding.pry
		@restaurant = current_user.restaurants.new(restaurant_params)
		if @restaurant.save
			redirect_to @restaurant
		else
			render "new"	
		end
	end

	def show
		@restaurant = Restaurant.find(params[:id])
	end

	private

	def restaurant_params
		params.require(:restaurant).permit(:name, :description, :avatar)
	end
end<commit_msg>added basic has many through params to restaurant's strong params<commit_after>class RestaurantsController < ApplicationController
	def index
		@restaurants = Restaurant.order(:name).page(params[:page]).per(6)
	end

	def new
		@restaurant = Restaurant.new	
	end

	def create
		@restaurant = current_user.restaurants.new(restaurant_params)
		if @restaurant.save
			redirect_to @restaurant
		else
			render "new"	
		end
	end

	def show
		@restaurant = Restaurant.find(params[:id])
	end

	private

	def restaurant_params
		params.require(:restaurant).permit(:name, :description, :avatar, :address, :event_time, votes_attributes: [:id, :likes])
	end

	def google_api
		Rails.application.secrets.google_api
	end
end
{'fraction_non_alphanumeric': 0.08950366151342555, 'fraction_numerical': 0.0008136696501220504, 'mean_word_length': 4.72093023255814, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1201823', 'n_tokens_mistral': 455, 'n_tokens_neox': 397, 'n_words': 96}