Topic: Dynamic drop-down

I am trying to build a dynamic drop-down menu and i am not sure how i am getting this wrong it works fine statically

app/helpers/application_helper.rb

def contact_type
    [
      if  @company.staff.cell
        ['cell - ' + @company.staff.cell ,'cell']
      end
    ]
  end
end 

This works by itself but i have a couple of other tributes  i want to check so we i get a systax error

@count = 0
    [
      if  @company.staff.cell
        ['cell - ' + @company.staff.cell ,'cell']
      end
      if  @company.staff.office
        ['office - ' + @company.staff.office ,'office']
      end
    ]
  end

syntax error, unexpected keyword_if, expecting ']'

Last edited by moiseszaragoza (2012-06-27 14:55:25)