Browse files

use attr_value.class.name.tableize instead of attribute.pluralize for

some complex belongs_to sentence. For example:
belongs_to :owner, :class_name => "User"
  • Loading branch information...
1 parent cbaf25f commit bb779a914698791f530bde0bd9bd45c6613a8426 @flyerhzm committed Feb 22, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/helpers/admin/table_helper.rb
View
2 app/helpers/admin/table_helper.rb
@@ -146,7 +146,7 @@ def typus_table_belongs_to_field(attribute, item)
att_value = item.send(attribute)
content = if !att_value.nil?
if @current_user.can?(action, att_value.class.name)
- link_to item.send(attribute).to_label, :controller => "admin/#{attribute.pluralize}", :action => action, :id => att_value.id
+ link_to item.send(attribute).to_label, :controller => "admin/#{att_value.class.name.tableize}", :action => action, :id => att_value.id
else
att_value.to_label
end

0 comments on commit bb779a9

Please sign in to comment.