Rails Best Practices Page


#1

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


#2

Yes. I like this idea.

On 1/17/06, Adam D. 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


"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


#3

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

thanks everyone.

adam


#4

I think that is a great idea!


#5

On 1/17/06, Adam D. 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.
:slight_smile:

Michael T.


#6

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


#7

On 1/17/06, Adam D. 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