app/helpers/admin_helper.rb
#
# Express the relationship relative to the "feature" arg node
#
Express the relationship relative to the "feature" arg node
Express the relationship relative to the " feature " arg node
def feature_relation_role_label(feature, relation, opts={})
    options={
      :use_first=>true,:use_second=>true,:use_relation=>true,
      :link_first=>true,:link_second=>true,:link_relation=>true
    }.merge(opts)
    relation.role_of?(feature) do |other,sentence|
      items=[]
      if options[:use_first]
        items << (options[:link_first] ? 
          (options[:use_names] ? f_link(feature, admin_feature_path(feature)) : feature_link(feature)) : 
          feature_label(feature))
      end
      if options[:use_relation]
        sentence = sentence
        items << (options[:link_relation] ? link_to(sentence, admin_feature_feature_relation_path(feature, relation)) : sentence)
      end
      if options[:use_second]
        items << (options[:link_second] ? 
          (options[:use_names] ? f_link(other, admin_feature_path(other)) : feature_link(other)) : 
          feature_label(other))
        if options[:show_feature_types]
          items << "(" + other.object_types.collect{|type| type.title }.join(", ") + ")"
        end
      end
      items.join(" ").html_safe
    end
  end
def feature_relation_role_label ( feature , relation , opts = { } ) options = { :use_first => true , :use_second => true , :use_relation => true , :link_first => true , :link_second => true , :link_relation => true } . merge ( opts ) relation . role_of? ( feature ) do | other , sentence | items = [ ] if options [ :use_first ] items << ( options [ :link_first ] ? ( options [ :use_names ] ? f_link ( feature , admin_feature_path ( feature ) ) : feature_link ( feature ) ) : feature_label ( feature ) ) end if options [ :use_relation ] sentence = sentence items << ( options [ :link_relation ] ? link_to ( sentence , admin_feature_feature_relation_path ( feature , relation ) ) : sentence ) end if options [ :use_second ] items << ( options [ :link_second ] ? ( options [ :use_names ] ? f_link ( other , admin_feature_path ( other ) ) : feature_link ( other ) ) : feature_label ( other ) ) if options [ :show_feature_types ] items << "(" + other . object_types . collect { | type | type . title } . join ( ", " ) + ")" end end items . join ( " " ) . html_safe end end
Express the relationship relative to the "feature" arg node
Express the relationship relative to the " feature " arg node
feature
<not_specific>
relation
<not_specific>
opts
<not_specific>