# Rails Best Practices Page

**URL:** <https://www.ruby-forum.com/t/rails-best-practices-page/52648>\
**Category:** Rails\
**Created:** [January 17, 2006, 3:45pm UTC](https://www.ruby-forum.com/t/rails-best-practices-page/52648 "2006-01-17T15:45:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [January 17, 2006, 3:45pm UTC](https://www.ruby-forum.com/t/rails-best-practices-page/52648/1 "2006-01-17T15:45:52Z")

</div>

Hey,

I have been progressively learning more and more rails each day  
(from both a current project, reading the agile book, and this list).  
Does anybody think it would be beneficial to have kind of like a rails  
“Best Practices” page that lists some of the better ways of handling  
certain functions of rails (that are common in most apps) that are  
both more elegant, and efficient.

For example a lot of people are unware of the :include part of a find,  
or maybe even using collection\_of\_partials. maybe taking the 10-20  
most common tasks in rails, and showing the way the most seasoned  
rails developers are handling the same problems?

I find myself 2 weeks after coding part of a project always saying,  
“Man i should have done it that way, i could have saved 10 lines of  
code and its so much more readable”.

any thoughts ?

adam

---

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [January 17, 2006, 5:01pm UTC](https://www.ruby-forum.com/t/rails-best-practices-page/52648/2 "2006-01-17T17:01:06Z")

</div>

Yes. I like this idea.

On 1/17/06, Adam D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> or maybe even using collection\_of\_partials. maybe taking the 10-20
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
"Her faults were those of her race and sex; her virtues were her own.  
Farewell, and if for ever - "

– “Travels with a Donkey in the Cevennes” by Robert Louis Stevenson

---

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [January 17, 2006, 5:19pm UTC](https://www.ruby-forum.com/t/rails-best-practices-page/52648/3 "2006-01-17T17:19:11Z")

</div>

Ok I have added a page to the Wiki and linked it from the main. Any  
seasoned rails developers who would like to contribute what they think  
is a “Best Practice”, please feel free to contribute to the Wiki. I  
think it will definitely save a lot of developers a lot of time for  
rails tasks that we do most often.

[http://wiki.rubyonrails.org/rails/pages/RailsBestPractices](http://wiki.rubyonrails.org/rails/pages/RailsBestPractices)

thanks everyone.

adam

---

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [January 17, 2006, 8:34pm UTC](https://www.ruby-forum.com/t/rails-best-practices-page/52648/4 "2006-01-17T20:34:59Z")

</div>

I think that is a great idea!

---

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [January 17, 2006, 6:22pm UTC](https://www.ruby-forum.com/t/rails-best-practices-page/52648/5 "2006-01-17T18:22:22Z")

</div>

On 1/17/06, Adam D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Does anybody think it would be beneficial to have kind of like a rails  
> > > "Man i should have done it that way, i could have saved 10 lines of

Great idea. I find myself doing the same thing. After three hours of  
hacking something together, I find out I could have done it in one line.  
🙂

Michael T.

---

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [January 17, 2006, 9:47pm UTC](https://www.ruby-forum.com/t/rails-best-practices-page/52648/6 "2006-01-17T21:47:24Z")

</div>

Ok Seasoned Developers.

Please post what you find to be Best Practices of your “everyday”  
coding in rails for the rest of the world to share on the wiki page.

thanks  
adam

---

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [January 18, 2006, 11:29pm UTC](https://www.ruby-forum.com/t/rails-best-practices-page/52648/7 "2006-01-18T23:29:28Z")

</div>

On 1/17/06, Adam D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Ok Seasoned Developers.
> 
> Please post what you find to be Best Practices of your “everyday”  
> coding in rails for the rest of the world to share on the wiki page.
> 
> thanks  
> adam

I find myself having to generate a form with a line for each record in  
a collection, plus some blanks for additional input. I’d like to know  
how best to handle the identification and iteration of those params  
when they come back. This seems like something a lot of people have  
probably reinvented over the years…

Thanks!

- Ian
