# Rails Code Indentation

**URL:** <https://www.ruby-forum.com/t/rails-code-indentation/169573>\
**Category:** Rails\
**Created:** [June 5, 2009, 12:34pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573 "2009-06-05T12:34:02Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 5, 2009, 12:34pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/1 "2009-06-05T12:34:02Z")

</div>

Hi All,

Rails code must be readable, formatted and well indented.  
I wanted to do indent code in my previous projects.  
Is there any built in rails plugin/gem that can help me to  
indent my existing code.

Any ideas will be really appreciated !

NOTE: Please don’t suggest editor plugins.

Thanks & Regards,  
Sandip R~

–  
Ruby on Rails Developer

> **[Blogs - Neuigkeiten - Artikel - Webseiten - Medien](https://www.sosblog.com/)**
>
> Auf SOSblog geht es um aktuelle Blogs, Neuigkeiten, Artikel, Webseiten und Medien. Wir bringen interessante neue Webseiten aus den Tiefen des Webs.

> **[Judul Situs](https://funonrails.wordpress.com)**
>
> “Cinta tidak mengenal batas. Cinta mampu melewati rintangan, melompati pagar, menembus dinding untuk mencapai tujuannya dengan penuh harapan.” — Maya Angelou

> **[Josh Software | Custom Software Development Services & Solutions](https://joshsoftware.com/)**
>
> JoshSoftware offers custom software development Services & Solution that provides enterprise, software development services for web & mobile.

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 5, 2009, 10:50pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/2 "2009-06-05T22:50:03Z")

</div>

2009/6/5 Sandip R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Hi All,
> 
> Rails code must be readable, formatted and well indented.  
> I wanted to do indent code in my previous projects.  
> Is there any built in rails plugin/gem that can help me to  
> indent my existing code.
> 
> Any ideas will be really appreciated !

Do you mean you want a plugin or gem that edits the file it is  
interpreting? That doesn’t make sense to me.

> NOTE: Please don’t suggest editor plugins.

Why not? Any decent editor will do this for you.

Colin

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 5, 2009, 11:20pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/3 "2009-06-05T23:20:06Z")

</div>

well, eclipse wont!

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 5, 2009, 11:23pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/4 "2009-06-05T23:23:38Z")

</div>

On Fri, Jun 5, 2009 at 2:19 PM, JannaB[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> well, eclipse wont!

Note: the man said “decent” – eclipse is barely an editor at all… 🙂

> > Why not? Any decent editor will do this for you.

–  
Hassan S. ------------------------ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 6, 2009, 3:34pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/5 "2009-06-06T15:34:54Z")

</div>

What do you use asa good RoR editor then?

On Jun 5, 5:22 pm, Hassan S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 6, 2009, 3:54pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/6 "2009-06-06T15:54:21Z")

</div>

2009/6/6 JannaB [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> What do you use asa good RoR editor then?

I find jEdit (with the appropriate plugins) does a pretty good job.  
Available for Win and Linux.

Colin

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 6, 2009, 4:53pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/7 "2009-06-06T16:53:19Z")

</div>

2009/6/6 Hassan S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> On Sat, Jun 6, 2009 at 6:53 AM, Colin L.[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > > What do you use asa good RoR editor then?
> > 
> > I find jEdit (with the appropriate plugins) does a pretty good job.  
> > Available for Win and Linux.
> 
> Actually, since it’s Java-based, it runs on anything with a JVM,  
> including Macs. And it’s incredibly configurable and extensible.

I thought it would likely work on Macs also, but I have no personal  
experience of this so I thought it better not to say what I was not  
certain of. Usually when I do that I end up looking foolish. 🙂  
Colin

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 6, 2009, 4:21pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/8 "2009-06-06T16:21:27Z")

</div>

On Sat, Jun 6, 2009 at 6:53 AM, Colin L.[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > What do you use asa good RoR editor then?
> 
> I find jEdit (with the appropriate plugins) does a pretty good job.  
> Available for Win and Linux.

Actually, since it’s Java-based, it runs on anything with a JVM,  
including Macs. And it’s incredibly configurable and extensible.

That said, I use both jEdit and NetBeans, which among other  
strengths does a very nice job of reformatting raggedy code 🙂

## FWIW,

Hassan S. ------------------------ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 6, 2009, 4:53pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/9 "2009-06-06T16:53:56Z")

</div>

On Jun 6, 8:34 am, JannaB [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> What do you use asa good RoR editor then?
> 
> On Jun 5, 5:22 pm, Hassan S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > On Fri, Jun 5, 2009 at 2:19 PM, JannaB[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > > well, eclipse wont!
> 
> > Note: the man said “decent” – eclipse is barely an editor at all… 🙂

If you’re really attached to eclipse, I would suggest using Aptana’s  
RadRails which you can install as a plugin. I started out that way,  
but didn’t like the extra layer of complexity eclipse added, so I blew  
that out and just am using Aptana’s IDE with RadRails directly. I’ve  
also used JEdit, and with the Ruby plugins it does a lot of things  
very well, but I like an IDE environment a little better (personal  
choice.) --Good luck, Wayne

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 7, 2009, 6:08pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/10 "2009-06-07T18:08:33Z")

</div>

Netbeans is good for that.

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 7, 2009, 10:08pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/11 "2009-06-07T22:08:45Z")

</div>

RubyMine has an excellent code formatter. Just write your code and Cmd-  
Option-L.

Scott

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 7, 2009, 11:29pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/12 "2009-06-07T23:29:38Z")

</div>

Em 06-06-2009 10:34, JannaB escreveu:

> What do you use asa good RoR editor then?

What do you (all the list) think about Redcar?

> **[XOILAC TV - Xem bóng đá trực tiếp Xôi lạc TV - Xem TTBD #1](https://xoilactvtructiepbongda.live/)**
>
> Xoilac tv là kênh xem bóng đá trực tiếp 24/7 phát sóng trực tiếp bóng đá hơn 20 giải đấu. Chất lượng hình ảnh HD 4K, tốc độ ổn định, xem ttbd trên mọi thiết bị.

I’m using it actually and thought that I can be a very good editor.

davi

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 7, 2009, 5:04am UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/13 "2009-06-07T05:04:40Z")

</div>

JannaB wrote:

> What do you use asa good RoR editor then?

NetBeans indents very well.

Cheers,  
Mohit.  
6/7/2009 | 11:03 AM.

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [November 1, 2009, 9:02pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/14 "2009-11-01T21:02:45Z")

</div>

I’ve written a Textmate plugin that indents Ruby code (rather better  
than Textmate does on it’s own but not as well as Netbeans which, as  
mentioned earlier in the thread does a great job).

It’s all written in Ruby so would be easy enough to extract into a gem  
(it’s on my to do list).

You can see it all here

> **[GitHub - mocoso/code-beautifier.tmbundle: An abandoned Textmate bundle for...](https://github.com/mocoso/code-beautifier.tmbundle)**
>
> An abandoned Textmate bundle for indenting code. Contribute to mocoso/code-beautifier.tmbundle development by creating an account on GitHub.

If anyone’s interested in using a gem based on this then say (and maybe  
that’ll poke me to get it done).

J.

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [March 13, 2010, 7:09pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/15 "2010-03-13T19:09:50Z")

</div>

Hi Joel,

Thanks for the plugin !  
I would like to use it but i am working on ubuntu machine and  
textmate works with mac. meanwhile i found rails.vim script for  
vim that solved my auto indentation problems.

[http://www.funonrails.com/2010/02/vim-editor-for-ruby-on-rails.html](http://www.funonrails.com/2010/02/vim-editor-for-ruby-on-rails.html)

On Mon, Nov 2, 2009 at 1:32 AM, Joel Chippindale \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> To post to this group, send email to [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> To unsubscribe from this group, send email to  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> For more options, visit this group at  
> [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en)  
> -~----------~----~----~----~------~----~------~–~—

–  
Sandip

* * *

> **[Fun On Rails](http://funonrails.com/)**
>
> Journal of a Web Developer #ruby #rails #JS

---

<div class="post-metadata">

**Author:** ![san2821](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@san2821](https://www.ruby-forum.com/u/san2821)\
**Post date:** [June 8, 2009, 4:26pm UTC](https://www.ruby-forum.com/t/rails-code-indentation/169573/16 "2009-06-08T16:26:40Z")

</div>

Hi guys,

Thanks for your reply !

I am using vi editor with rails.vim plugin as well as my own personal  
indentation settings for my current developments.

but i think there should be plugin/gem to indent your rails application  
directory LIKE annotate models plugin ( Lazy peoples ).  
sorry to say but i don’t wanted to indent my previous developments using  
editors.

- Sandip R~

On Mon, Jun 8, 2009 at 1:36 AM, Scott T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > > JannaB wrote:
> > > 
> > > > What do you use asa good RoR editor then?
> > 
> > > NetBeans indents very well.  
> > > Cheers,  
> > > Mohit.  
> > > 6/7/2009 | 11:03 AM.

–  
Ruby on Rails Developer  
[http://sandip.sosblog.com](http://sandip.sosblog.com)

> **[Judul Situs](https://funonrails.wordpress.com)**
>
> “Cinta tidak mengenal batas. Cinta mampu melewati rintangan, melompati pagar, menembus dinding untuk mencapai tujuannya dengan penuh harapan.” — Maya Angelou

> **[Josh Software](https://www.joshsoftware.com)**
>
> The central landing page showcasing Josh Software's overall service offerings, value proposition, client impact, and core technologies.
