Display Partial if user is on a specific page

If I have a page with the following URL: http://www.mywebsite.com/users/profile/edit

How would I display partial ONLY if the user is on this particular page?

Someone suggested this code, but the syntax confuses me, and I was hoping for something more specific. <%= render :partial => "foo/bar" if @conditions %>

+4
source share
1 answer

Usually you place a call to display a partial in the view for this action. If you have a view used by more than one, the standard procedure is the same as you describe, where @conditions represents some arbitrary conditions. It could be like this:

 <%= render(:partial => 'example') if (params[:action] == 'edit') %> 
+13
source

All Articles