Update a Destination I


#1

Help! I am stuck on adding a private method, destination_params below the edit action in the Destinations controller. I have put the code in exactly how the lesson is telling me, but I keep pulling an error and it won't let me move on to the next step. I don't want to get the code until I have exhausted every other option. Thanks!
Here is my code:

   private
    def destination_params
    
  params.require(:destination).permit
  (:name, :description)
  end

And here is the error I'm pulling:

app/controllers/destinations_controller.rb:15: syntax error, unexpected ',', expecting ')' (SyntaxError)

What the heck?!
Cheers.


#2

Hi Fox,

I think the new line between permit and (:name, ...) is causing the problem. Does the error go away if you do this instead?

params.require(:destination).permit(:name, :description)
                                  # ↑ no new line

#3

I had to go ahead and use get code to bypass an error that I think my browser was giving me, I had to re-log in so I was put back to the first step. Anyway, the code that passed that was entered for me ended up being this:

private 
  	def destination_params 
    	params.require(:destination).permit(:name, :description) 
  	end

So yes, that was the problem. Thanks!