Hmm... maybe you do need a table name involved: Controller:
def create hash = params[:faction] hashnew = save_ids(hash, 'FactionContent') Faction.create(hashnew) @faction = Faction.find(:last, :order => 'id') end And that other routine: def save_ids(arguments, table) ret = Hash.new arguments.each_pair {|key, value| table.constantize.create(:english => value) content = table.constantize.find(:last, :order => 'id') ret[key] = content.id.to_s } return ret end -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.