Instead of having all that nasty code in the html try just defining controler as follows:
@category = @params['category']
@recipes_tmp = Recipe.find_all
@recipes = 
if (@category == nil) ||
(@category == recipe.category.name)
@recipes << recipe
I think this better shows the elegance of having a MVC framework like Rails.
Better yet to let the DB do the work in the Recipe.find query and/or add a new method to the Recipe model for this behaviour but this gets the point across...