Skip to content

Commit

Permalink
use attr_value.class.name.tableize instead of attribute.pluralize for
Browse files Browse the repository at this point in the history
some complex belongs_to sentence. For example:
belongs_to :owner, :class_name => "User"
  • Loading branch information
flyerhzm committed Feb 22, 2010
1 parent cbaf25f commit bb779a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/admin/table_helper.rb
Expand Up @@ -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
Expand Down

0 comments on commit bb779a9

Please sign in to comment.