Closed Krafalski closed 8 years ago
What I've tried to to: Move the links in and out of the if statement. Remove the if statement. Copy paste and google the exact message. Comb through the files and try to make sure that things are as correct I know how to make them.
needed to add
def index
current_user
end
to controllers of breath, esque and colors
OR
in application.html.erb change
<%= link_to "Mood", user_mood_ratings_path(@user) %>
to
<%= link_to "Mood", user_mood_ratings_path(session[:current_user_id]) %>
the latter solution was chosen
Thanks Colin!
When a user is NOT logged in the links to Breath Colors and Esque in the 'Menu' (application.html.erb) work fine. When a user is logged in, they can access their journal but cannot access Breath Colors Esque: ActionController::UrlGenerationError in Breaths#index Showing /Users/karolinrafalski/dev/considerwater/consider_water_app/app/views/layouts/application.html.erb where line #18 raised:
No route matches {:action=>"index", :controller=>"journal_entries", :user_id=>nil} missing required keys: [:user_id]
note: link_to "Journal" is highlighted
not sure why :user_id is nil in this case, but works in other places?