Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 846
  • Last Modified:

Auto Tabifier/Indenter for .erb Ruby file

I have some code, as seen below. Is there any free online tool I can use to tidy up the indents as it has been done by several different developers and is really messy at the moment.

It's not completely HTML so I can't use the straight HTML tabifier.
<div id="two-column" class="clearfix">
  <div class="left">
	<h2>Why Choose Pick A Quote?</h2>
	Our intelligent system matches you with the right providers. This ensures you get the right people for your job. About 2-3 lines of text needed here.<br /><br /><a href="how-it-works">How It Works >></a>
	<br /><br />
	<h2>Popular Categories</h2>
    <table id="categories">
      <%- @categories.in_groups_of(3, false) do |group| %>
        <tr>
          <%- group.each do |category| %>
            <td class="popular"><%= link_to category.name, subcategory_path(category) %></td>
          <%- end %>
        </tr>
      <%- end %>
    </table>
	<div style="padding-top: 8px"><%= small_button_link "View all categories", categories_url %></div>
	<br /><br />
	<div class="columns clearfix">
      <div class="col-3">
        <h2>For Consumers</h2>
        <p>
          If you need something done, the benefits of PickAQuote.com.au are tremendous
        </p>
        <%= big_button_link "Create Account", signup_url %>
      </div>
      <div class="col-3 last">
        <h2>For Businesses</h2>
        If you are a business and want to win more work, new leads will be sent to your inbox for free
      </div>
    </div>
  </div>
  <div class="right clearfix">
	<%= render :partial => "shared/modules/post_your_job"%>
    <%= render :partial => "shared/modules/promote_your_business" unless current_user %>
    <%- module_box "Latest Jobs" do %>
      <%- @jobs.each do |job| %>a
        <%= link_to job.title, job %>
        <br />
        <span class="subtext"><%= "#{job.location.value if job.location}" %></span>
        <br /><br />
      <%- end %>
	  <div style="text-align: right"><a href="/categories" class="more-jobs">More</a></div>
    <%- end %>
  </div>
</div>
<%- content_for :header do %>
<div class="title">We Find The Right Professional For You</div>
<div align="center" style="padding-bottom: 7px">
	<table> 
		<tr> 
			<td class="how-it-works-1">Need work done?<br />Post your job</td> 
			<td class="how-it-works-arrow"></td>
			<td class="how-it-works-2">Businesses compete<br />for your work</td>
			<td class="how-it-works-arrow"></td>
			<td class="how-it-works-3">Pick the best,<br />save time and money!</td> 
		</tr> 
	</table>
</div>
<%- end %>

Open in new window

0
hubfub
Asked:
hubfub
  • 2
1 Solution
 
JESiiCommented:
You might try Vim (Vi Improved) at http://www.vim.org. It recognizes lots of different languages, including rails, has a smart indenter, and tons of plugins that are very useful.  For example, here's a link that talks about using Vim with Rails (not exactly on-topic, but indicative of what you can do with Vim).
0
 
hubfubAuthor Commented:
Is there something a bit easier to use than this?
0
 
JESiiCommented:
Try this: http://infohound.net/tidy/ 

It does HTML cleanup, and -- since the erb commands are enclosed in angle brackets, it may work.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now