myexperiment-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Myexperiment-discuss] Get credits and tags


From: Linde, A.E.
Subject: Re: [Myexperiment-discuss] Get credits and tags
Date: Fri, 7 Nov 2008 16:07:51 +0000

Many thanks, Don. That .join is certainly a lot neater than what I had to get the ‘,’ separators.

T.


On 07/11/2008 11:03, "Don Cruickshank" <address@hidden> wrote:

Hi Tony,
 
The two lines you want are:
 
 cn_<%= workflow.id %> = [<%= (workflow.creditors.map do |c| "\"#{c.creditor.name}\"" end).join(",") %>];
  ta_<%= workflow.id %> = [<%= (workflow.tags.map do |t| "\"#{t.name}\"" end).join(",") %>];

For example, this produces the following for workflow 150:

  cn_150 = ["Pieter Neerincx","Alako"];
  ta_150 = ["biomoby","disambiguation","gene symbol","text mining"];

Regards,
Don.
 

From: address@hidden [mailto:address@hidden] On Behalf Of Linde, A.E.
Sent: 06 November 2008 17:19
To: myexperiment-discuss
Subject: [Myexperiment-discuss] Get credits and tags

Sorry to bother everyone again, but I need to get just the names of creditors and tags against each workflow. I’ve copied the stuff from _table.rhtml and got:

    <% unless (creditors = workflow.creditors).empty? %>    cn_<%= workflow.id %> = "<% creditors.each do |c| %><%= contributor(c.creditor_id, c.creditor_type) %><% end %>";    <% else %>    cn_<%= workflow.id %> = "";    <% end %>

   <% unless (tags = workflow.tags).empty? %>    ta_<%= workflow.id %> = "<%= tag_cloud_from_collection tags, true %>";    <% else %>    ta_<%= workflow.id %> = "";    <% end %>
But of course contributor and tag_cloud... give full html stuff. I have tried to figure out where to get this information by searching the code for relevant bits but have failed. (Maybe now I understand a little bit more I could do with another explanation of how the myExperiment rails app is structured and works.)

In the meantime, could I ask just for the creditor names and tag names to plug into the above code?

Thanks,
Tony.




--
Tony Linde
Project Manager
Department of Physics & Astronomy
University of Leicester

reply via email to

[Prev in Thread] Current Thread [Next in Thread]