I'm trying to understand an app in which it creates a link via link_to to new_user_session_path. In my controller, there is no new nor session. The generate link is users/sign_in which you can see here : [ListenUp][1]. Also, sign_in is not in the controller. My hunch is that it is some RoR magic.
The controller :
class UsersController < ApplicationController
def index
@users = User.all
end
def show
@user = User.find_by_permalink(params[:id])
@songs = Song.where(user: @user)
@friendships = @user.all_friendships
end
end
The routes
Rails.application.routes.draw do
devise_for :users
resources :users
resources :friendships
root 'pages#search'
resources :pages
resources :playlists
resources :songs
get 'search' => 'pages#search'
get 'search_results' => 'pages#search_results'
end
Part of the view that I'm trying to figure out :
<li><%= link_to "sign in", new_user_session_path %></li>
<li><%= link_to "sign up", new_user_registration_path %></li>
Thanks
[1]: http://listenup-songshare.herokuapp.com/