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

Navigating links.

I am doing the lesson about the navigating links and I've stuck a little bit with the de;ete method. Here is my code.

 <li><%= link_to current_user.full_name, edit_user_registration_path %></li>
                    <li><%= link_to "Log Out", destroy_user_session_path, method: :delete %></li>       

according to the lesson, it should print an error, that it can't displey the current user. Instead it prints

No route matches [GET] "/users/sign_out"

which shouldn't be.

In addition if I try to skip this and go on adding the code

<% if user_signed_in? %>

<% end %>

Above and below, nothing changes.

How does your routes.rb looks like?

Personally, here is my routes for authentications: resources :authentications

devise_for :users, path_names: {sign_in: "login", sign_out: "logout"},
controllers: {omniauth_callbacks: "authentications", registrations: "registrations"}

devise_scope :user do
get 'register', to: 'devise/registrations#new',as: :register
get 'login', to: 'devise/sessions#new',as: :login
get 'logout', to: 'devise/sessions#destroy',as: :logout
end

And in my navigation: <li><%= link_to "Log out", logout_path %></li>

Hope it'll help

Unfortunately because I didn't have any particular problem anderstanding Ruby,or on the tests I moved on wtih the lectures. But now it is all mest up. So I will start the project again. I hope when I get to the same point I won't have the say problem. Thank you very much for the help! When I get there again I'll let you know!