Permalink
Browse files

fixed bug with has_many through link

Signed-off-by: Francesc Esplugas <fesplugas@intraducibles.net>
  • Loading branch information...
Luqman Amjad Francesc Esplugas
Luqman Amjad authored and Francesc Esplugas committed May 9, 2009
1 parent 192d261 commit 8e7306ce5fb2d71688703e81de6a2825aad19422
Showing with 1 addition and 0 deletions.
  1. +1 −0 app/helpers/admin/form_helper.rb
@@ -205,6 +205,7 @@ def typus_form_has_many(field)
reflection = @resource[:class].reflect_on_association(field.to_sym)
association = reflection.macro
foreign_key = reflection.primary_key_name
+ foreign_key = foreign_key.pluralize if reflection.through_reflection
link_options = { :controller => "admin/#{field}",
:action => 'new',

0 comments on commit 8e7306c

Please sign in to comment.