-
Find (regex):
<h1>Listing (.*?)</h1>
-
Replace:
<% content_for :page_title do %> $1s - <% end %> <div class="container"> <div class="page-header"> <h1> <div class="pull-left"> <%= link_to '<span class="glyphicon glyphicon-step-backward" aria-hidden="true"></span>'.html_safe, root_path, class: 'btn btn-default', title: 'Back' %> </div>
<div class="pull-right"> <%= link_to '+ New $1', [:new, :$1], class: 'btn btn-success' %> </div> $1s
</h1> </div>
- Find (regex):
<br>
<%= link_to 'New(.*)%>
- Replace:
</div>
- Find (text):
<th colspan="3"></th>
- Replace: [nothing]
- Find (regex):
<td><%= link_to 'Show', (.*?) %></td> <td><%= link_to 'Edit', (.*?) %></td> <td><%= link_to 'Destroy',(.*?)%></td>
- Replace: [nothing]
- Find (text):
<table>
- Replace:
<table class="table table-striped table-hover">
- Find (regex):
<tbody> \s+<% @(.*)?.each
- Replace:
<tbody> <% unless @$1.any? %> <tr id="empty-table"> <td class="bg-warning" colspan="2">No $1 created yet.</td> </tr> <% end %> <% @$1.each
- Find (regex):
\| %> <tr> <td><%= (.?)\.(.?) %>
- Replace:
| %> <tr> <td><%= link_to $1.$2, $1 %>
- Find (regex):
<tr> <td><%= link_to (.*?)\.
- Replace:
<tr class="linked-row" data-href="<%= $1_path($1) %>"> <td><%= link_to $1.
Required Javascript:
$(document).ready(function($) {
$(".linked-row").click(function() {
window.document.location = $(this).attr("data-href");
});
});
Recommended CSS:
tr.linked-row { cursor: pointer; }
- Find (regex):
<p id="notice"><%= notice %></p>
<p> <strong>(.?):</strong> <%= @(.?).(.*?) %> </p>
-
Replace:
<% content_for :page_title do %> '<%= @$2.$3 %>' $2 - <% end %> <div class="container"> <div class="page-header"> <h1> <div class="pull-left"> <%= link_to '<span class="glyphicon glyphicon-step-backward" aria-hidden="true"></span>'.html_safe, $2s_path, class: 'btn btn-default', title: 'Back to $2s' %> </div>
'<%= @$2.$3 %>' $2
</h1> </div> <p> <strong>$1:</strong> <%= @$2.$3 %> </p>
- Find (regex):
<%= link_to 'Back', (.*?)s_path %>
- Replace:
</div>
- Find (regex):
<p> <strong>(.*?):</strong> <%= @(.*?)\.(.*?) %> </p>
- Replace:
<div class="row"> <label class="col-sm-3 text-right text-muted">$1:</label> <div class="col-sm-9"><%= @$2.$3 %></div> </div>
- Find (regex):
<h1>New (.*?)</h1>
- Replace:
<% content_for :page_title do %> New $1 - <% end %> <div class="container"> <div class="page-header"> <h1> New $1 </h1> </div>
- Find (regex):
<%= render 'form' %>
<%= link_to 'Back', (.*?)s_path %>
- Replace:
<%= render 'form' %>
<%= link_to 'Cancel', $1s_path, class: 'btn btn-default' %> </div>
- Find (regex):
<%= form_for\(@(.*?)\) do \|f\| %>
- Replace:
<%= form_for(@$1, { html: { role: 'form', class: 'form-horizontal'}}) do |f| %>
- Find (text):
<div id="error_explanation">
- Replace:
<div id="error_explanation" class="alert alert-danger" role="alert">
- Find (regex):
<h2>(.*?)from being saved:</h2>
- Replace:
<strong>$1from being saved:</strong>
- Find (regex):
<div class="field"> <%= f.label :(.*?) %><br> <%= f.(.*?) :(.*?) %> </div>
- Replace:
<div class="col-sm-12"> <div class="form-group<%= f.object.errors[:$1].empty? ? '' : ' has-error has-feedback' %>"> <%= f.label :$1, { class: 'control-label col-sm-1' } %> <div class="col-sm-11"> <%= f.$2 :$1, { class: 'form-control' } %> </div> </div> </div>
- Find (text):
<div class="actions"> <%= f.submit %> </div>
- Replace:
<div class="actions text-center"> <%= f.submit class: 'btn btn-success' %> </div>
- Find (regex):
<%= f.check_box :(.*?), { class: 'form-control' } %>
- Replace:
<div class="input-group"> <span class="input-group-addon"> <%= f.check_box :$1 %> </span> <%= f.label :$1, 'Yes', class: 'form-control btn btn-default text-left' %> </div>