app/controllers/reviews_controller.rb
#this method takes care of creating new reviews
this method takes care of creating new reviews
this method takes care of creating new reviews
def create
		@reviews = @share.reviews.order(priority: :asc)
		@reviewToAlter = @share.reviews.new(review_params)
		if @reviewToAlter.save
			redirect_to share_reviews_path(@share), notice: "Review saved!"
		else
			flash[:alert] = "Error : #{@reviewToAlter.errors.full_messages.to_sentence}"
			render :index
		end
	end
def create @reviews = @share . reviews . order ( priority : :asc ) @reviewToAlter = @share . reviews . new ( review_params ) if @reviewToAlter . save redirect_to share_reviews_path ( @share ) , notice : "Review saved!" else flash [ :alert ] = "Error : #{@reviewToAlter.errors.full_messages.to_sentence}" render :index end end
this method takes care of creating new reviews
this method takes care of creating new reviews