Hi all,
I followed the example on: http://www.roryhansen.ca/?p=9 for creating
related drop-down lists.
However, this code actually creates HTML in the controller component:
@albums = Album.find_all_by_artist_id(@params[“artist_id”])
@html = “”
@html += “No Album”
@albums.each do |@album|
@html += “#{@album.album_name}”
end
@html += “”
I would think this is considered ‘bad practice’, because this is the job
of
the view.
How could one rewrite this and get a cleaner controller code?
Regards,
Harm de Laat