Rails: Cleaning up the UX Part 2
We'll be continuing to clean up the ui / ux of our blog application. We'll focus on the admin action bar in this episode.
We'll need to do some styling clean up.
# remove container-fluid from action_bar div
<div class='action_bar container-fluid'>
# move every thing inside the container
Tweaking the States Filter
We'll also need to tweak the helper function to use the new classes from bootstrap 4.
class << self
statuses(view).map do |status, path|
view.content_tag :li, class: 'nav-item' do
class: ['nav-link', active(view, path)].join(' ')
Separate Admin Navbar
We need a separate navbar for the admin area since we'll have admin specific features on it. We'll simply copy the existing navbar and create a new instance of it for the admin area. Simply copy app/views/application/_navbar.html.erb into app/views/admin/base/_navbar.html.erb this will separate the admin's navbar from the main application. We also need to rename the brand area of the navbar.
<%= link_to 'Writefully', root_path, class: 'navbar-brand' %>
<%= link_to 'Admin, root_path, class: 'navbar-brand' %>
This way we can clearly see the separation from the front-end.