<%= render 'search_form' %>

<% if @commits.any? %>
  <table class="table table-hover">
    <thead>
      <tr>
        <th class="col-xs-9">Message</th>
        <th class="col-xs-2">Repository</th>
        <th class="col-xs-1">SHA</th>
      </tr>
    </thead>
    <tbody>
      <% @commits.each do |commit| %>
      <tr>
        <td><%= commit.message %></td>
        <td><%= link_to commit.repo_full_name, "https://github.com/#{commit.repo_full_name}", { :target => "_blank" } %></td>
        <td><%= link_to commit.sha[0,7], "https://github.com/twbs/bootstrap/commit/#{commit.sha}", { :target => "_blank" } %></td>
      </tr>
      <% end %>
    </tbody>
  </table>
  <%= will_paginate @commits, :params => { :keyword => params[:keyword]} %>
<% end %>

<%= render 'search_form' %>

<% if @commits.any? %>
  <table class="table table-hover">
    <thead>
      <tr>
        <th class="col-xs-9">Message</th>
        <th class="col-xs-2">Repository</th>
        <th class="col-xs-1">SHA</th>
      </tr>
    </thead>
    <tbody>
      <% @commits.each do |commit| %>
      <tr>
        <td><%= highlight(commit.message, @keyword.split) %></td>
        <td><%= link_to commit.repo_full_name, "https://github.com/#{commit.repo_full_name}", { :target => "_blank" } %></td>
        <td><%= link_to commit.sha[0,7], "https://github.com/twbs/bootstrap/commit/#{commit.sha}", { :target => "_blank" } %></td>
      </tr>
      <% end %>
    </tbody>
  </table>
  <%= will_paginate @commits, :params => { :keyword => @keyword} %>
<% end %>

Add highlight to search results
Add highlight to search results
