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:

  1. any possibility around error? (and don't want assign @user variable every , don't want make list of page allowed)

  2. 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

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -