<div id="content-wrapper">
  <div id="single-column-wrapper">
    <div id="content">
      <p id="notice"><%= notice %></p>
      
      <h1>Listing News Articles</h1>
      
      <table>
        <thead>
          <tr>
            <th>Title</th>
            <th>Content</th>
            <th>Image url</th>
            <th colspan="3"></th>
          </tr>
        </thead>
      
        <tbody>
          <% @news_articles.each do |news_article| %>
            <tr>
              <td><%= news_article.title %></td>
              <td><%= news_article.content %></td>
              <td><%= news_article.image_url %></td>
              <td><%= link_to 'Show', news_article %></td>
              <td><%= link_to 'Edit', edit_news_article_path(news_article) %></td>
              <td><%= link_to 'Destroy', news_article, method: :delete, data: { confirm: 'Are you sure?' } %></td>
            </tr>
          <% end %>
        </tbody>
      </table>
      
      <br>
      
      <%= link_to 'New article', new_news_article_path %>
    </div>
  </div>
</div>

<div id="content-wrapper">
  <div id="single-column-wrapper">
    <div id="content">
      <p id="notice"><%= notice %></p>
      
      <h1>Listing News Articles</h1>
      
      <table>
        <thead>
          <tr>
            <th>Title</th>
            <th>Content</th>
            <th>Image url</th>
            <th colspan="3"></th>
          </tr>
        </thead>
      
        <tbody>
          <% @news_articles.each do |news_article| %>
            <tr>
              <td><%= link_to news_article.title, news_article %></td>
              <td><%= news_article.content %></td>
              <td><%= news_article.image_url %></td>
              <% if can? :show, @news_article %>
                <td><%= link_to 'Show', news_article %></td>
              <% end %>
              <% if can? :update, @news_article %>
                <td><%= link_to 'Edit', edit_news_article_path(news_article) %></td>
              <% end %>
              <% if can? :destroy, @news_article %> 
                <td><%= link_to 'Destroy', news_article, method: :delete, data: { confirm: 'Are you sure?' } %></td>
              <% end %>
            </tr>
          <% end %>
        </tbody>
      </table>
      
      <br>
      
      <% if can? :create, @news_article %>
        <%= link_to 'New article', new_news_article_path %>
      <% end %>
    </div>
  </div>
</div>

Add cancancan access control to news articles index view.
Add cancancan access control to news articles index view.
