Week4

require did not work and this is the solution I found.

Sent wirelessly from my BlackBerry device on the Bell network.
Envoyé sans fil par mon terminal mobile BlackBerry sur le réseau de Bell.

-----Original Message-----
From: brandoncc <notifications@github.com>
Date: Wed, 18 Jun 2014 21:15:46 
To: easante/myflix<myflix@noreply.github.com>
Reply-To: easante/myflix <reply@reply.github.com>
Cc: Emmanuel Asante<emmanuela.asante@gmail.com>
Subject: Re: [myflix] Week4 (#5)

> +    redirect_to people_path
> +  end
> +
> +  def destroy
> +    @friend = Friendship.find(params[:id])
> +    if @friend.destroy
> +      flash[:notice] = "#{@friend.friend.full_name} unfollowed."
> +    else
> +      flash[:alert] = "#{@friend.friend.full_name} could not be unfollowed."
> +    end
> +    redirect_to people_path 
> +  end
> +
> +private
> +  def friendship_params
> +    params.fetch(:friendship, {}).permit(:friend_id, :user_id)

Per section 4.5.3 of http://guides.rubyonrails.org/action_controller_overview.html, this style of strong parameters is provided so you can use it in the `new` action.  You should use the `require` style unless you cannot because you are using the strong params method in a `new` action.  Anytime data absolutely has to be present for your code to work properly, you need to use `require`.  In order to create your `Friendship` you need that data.

---
Reply to this email directly or view it on GitHub:
https://github.com/easante/myflix/pull/5/files#r13952928