Q:

Rails what does this line of code doing

Can anybody can explain me this line of code
<% child_nodes = node.is_a?(Department) ?  node.offices.where(parent_office_id: nil) : node.branch_offices %>

I am got confused by ? : 
what this is called  ? : 

A:

So this statement contains a ternary operator: child_nodes = node.is_a?(Department) ? 
If it evaluates to true the first condition is executed i.e.: node.offices.where(parent_office_id: nil)
Otherwise this code is ran: node.branch_offices
Hope this helps!