# Bad Smells sing in a rails application

**URL:** <https://www.ruby-forum.com/t/bad-smells-sing-in-a-rails-application/107950>\
**Category:** Ruby\
**Created:** [June 27, 2007, 7:36pm UTC](https://www.ruby-forum.com/t/bad-smells-sing-in-a-rails-application/107950 "2007-06-27T19:36:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/919ad9/32.png) [@pedro](https://www.ruby-forum.com/u/pedro)\
**Post date:** [June 27, 2007, 7:36pm UTC](https://www.ruby-forum.com/t/bad-smells-sing-in-a-rails-application/107950/1 "2007-06-27T19:36:34Z")

</div>

Hi all,

Sometime ago, i read the slides “when V is for Vexing: Patterns to  
DRY Up Your Views” (Bruce W. railsconf). They are not online  
anymore. I post one slide in my[1}… But only the bad smells sign in  
the view, and only problem, not the solution. here they are

1. Calling find on a model directly

2. Calling find on an association

3. Conditionally inserting content if/else clauses, case statements,  
etc

4. Doing a complex inline ma map, sor sort, t, select, etc on a  
collection

5. Assigning temporar temporary variables

I would like to ask for new bad smell signs. In the view, in the  
controller or in the model. (and discuss this , specially number 3)

Thanks

[1] :

> **[Bad Smells sign in rails code.](https://theplana.wordpress.com/2007/05/25/bad-smells-sign-in-rails-code/)**
>
> Calling find on a model direct 1 2 3 4 % Sales.find\_all\_by\_region(params\[:region\]) .each do |t| %\> # some inteligent code \<% end %\> alling find on an association Conditionally inserting co…

## –

Pedro Del G.

Email : removed\_email\_address@domain.invalid
