Ruby on Rails Wednesday, July 4, 2018

Thanks Colin

On Wed, Jul 4, 2018 at 8:16 PM, Colin Law <clanlaw@gmail.com> wrote:
On 4 July 2018 at 09:10, David Merrick <merrickdav@gmail.com> wrote:
> I only want the link <li><%= link_to "Users", users_path %></li> to be seen
> by admin users
>
> Header File
>
> <header class="navbar navbar-fixed-top navbar-inverse">
>   <div class="container">
>     <%= link_to "sample app", root_path, id: "logo" %>
>     <nav>
>       <ul class="nav navbar-nav navbar-right">
>         <li><%= link_to "Home", root_path %></li>
>         <li><%= link_to "Help", help_path %></li>
>          <% if logged_in? %>

Test the role of the current user here and only show the next line if
the role is admin.

>           <li><%= link_to "Users", users_path %></li>

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsLrziQNJWn5foz1Csrag12SNxt8O%3DEAcYnKkr2PGYQAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Dave Merrick

Tutor Invercargill

Website http://tutorinvercargill.co.nz/

Email merrickdav@gmail.com

Ph   03 216 2053

Cell 027 3089 169

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2B%3DMcKbmKvwZkiS9gVkHD3-NnMeDg_0_eS9ZUtSPd0BTAZV4zQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

1 comment:

lisa said...

Really Good stuff you mentioned here, very useful information.
Keep up the good work.
Virtual Assistant
https://www.plaxonic.com/virtual-assistant.php

Post a Comment