Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

ActionView::Template::Error: undefined method `user_friendships_path' for the creating friend ships tutorial

It seems I get this error after having the following in my new.html.erb:

<%= form_for @user_friendship, method: :post do |form| %> <div class="form form-actions"> <%= form.hidden_field :friend_id, @friend %> <%= submit_tag "Yes, Add Friend", class: 'btn btn-primary' %> <%= link_to "Cancel", profile_path(@friend), class: 'btn' %> </div>

The routes.rb ```Thefacebook::Application.routes.draw do get "profiles/show" devise_for :users, :controllers => {:registrations => "users/registrations"}

devise_scope :user do get '/register' => 'devise/registrations#new' get '/login' => 'devise/sessions#new' get '/logout' => 'devise/sessions#destroy' end resources :user_friendship resources :statuses get 'feed' => 'statuses#index' root to: 'statuses#index' get '/:id', to: 'profiles#show', as: 'profile'```

When I check my routes.rb, everything looks fine. I am not sure what went wrong. Here are my files:

Routes.rb ```Thefacebook::Application.routes.draw do get "profiles/show" devise_for :users, :controllers => {:registrations => "users/registrations"}

devise_scope :user do get '/register' => 'devise/registrations#new' get '/login' => 'devise/sessions#new' get '/logout' => 'devise/sessions#destroy' end resources :user_friendship resources :statuses get 'feed' => 'statuses#index' root to: 'statuses#index'

get '/:id', to: 'profiles#show', as: 'profile'```