denny/ShinyCMS-ruby

View on GitHub
plugins/ShinyBlog/app/components/shiny_blog/admin/menu/section_component.html.erb

Summary

Maintainability
Test Coverage
<% return unless @current_user.can? :list, :blog_posts %>

<%= component 'admin/menu/section',
    text: t( 'shiny_blog.admin.blog_posts.menu' ), icon: 'rss' do %>

  <%= component 'admin/menu/item', link: shiny_blog.blog_posts_path,
      text: t( 'shiny_blog.admin.blog_posts.index.title' ), icon: 'list' %>

  <%= component 'admin/menu/item', link: shiny_blog.new_blog_post_path,
      text: t( 'shiny_blog.admin.blog_posts.new.title' ), icon: 'pencil',
      if: @current_user.can?( :add, :blog_posts ) %>

<% end %>