[Rails] Best Practices question regarding views & controllers

Kevin Olbrich
Fri, 03 Mar 2006 14:11:28 -0000

I tend to put code in views that only affects the display of the data
and which relates to the rendering of links, buttons, etc.

I will frequently take ugly code and turn it into a helper or model
method just to keep things clean and reusable.

_Kevin


On Friday, March 03, 2006, at 8:15 AM, Josh on Rails
wrote:
>I''m hardly an expert or anything, but - especially if
you''re still
>learning - put it wherever you can make it work for now, and plan to
>refactor later.
>
>I find Ruby/Rails code easy to refactor, in general, so I don''t
think
>this is a major chore. And the odds are good that much of what you
>write when you''re learning it (deity knows I am!) is going to want
to
>be refactored before too long.
>
>
>
>-- Joshua
>
>On 3/3/06, Raphael Schmid <raphael@schwarzschmid.de> wrote:
>> Hi List!
>>
>> I''m reading the Agile book, as many online articles as I can,
but
>> there''s still some things that are just too hard to answer for
yourself.
>> In building my application, I often find myself putting code into my
>> views of which I am not quite certain it belongs there.
>>
>> Where do you usually draw the line? Is it okay to, say, loop through an
>> array of hashes that represents table column names and whether they
need
>> a certain colspan and build the table according to that?
>>
>> Any advice that you might have would be greatly appreciated!
>>
>> Best regards,
>> Raphael Schmid
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>> _______________________________________________
>> Rails mailing list
>> Rails@lists.rubyonrails.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>_______________________________________________
>Rails mailing list
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails





--
Posted with http://DevLists.com.  Sign up and save your time!