diff --git a/lib/active_scaffold/helpers/id_helpers.rb b/lib/active_scaffold/helpers/id_helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/active_scaffold/helpers/id_helpers.rb
+++ b/lib/active_scaffold/helpers/id_helpers.rb
@@ -3,7 +3,7 @@ module ActiveScaffold
     # A bunch of helper methods to produce the common view ids
     module IdHelpers
       def controller_id
-        @controller_id ||= (params[:parent_controller] || params[:controller] || params[:eid]).gsub("/", "__")
+        @controller_id ||= (params[:eid] || params[:parent_controller] || params[:controller]).gsub("/", "__")
       end
 
       def active_scaffold_id
Fix duplicate ids, and fix 'RJS Error when using a 1:N -> N:1 in nested scaffolds' reported in ActiveScaffold Google Group.