ruby - Rails, current_page?(user_path) giving an error -
i have element witch want hide on specific pages, example on pages located @ app/views/users/
(there have new.html.erb
; edit.html.erb
; show.html.erb
. , have div in layouts/application.html.erb
shown on pages, want hide it.
i thought can this:
<% unless current_page?(new_user_path) || current_page?(user_path) %> <div>some content</div> <% end %>
but give me error, pretty obvious: user_show method need id of user, not visiting pages variable @user
present. can land me help:
any possibility around error? (and don't want assign @user variable every , don't want make list of page allowed)
is there other way hide element on specific pages?
not entirely sure trying achieve, how can guard user not being present:
unless current_page?(new_user_path) || @user && current_page?(user_path(@user))
Comments
Post a Comment