Skip to content

Instantly share code, notes, and snippets.

@jamonholmgren
Created June 22, 2014 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamonholmgren/382a6cf9963c5f0b2248 to your computer and use it in GitHub Desktop.
Save jamonholmgren/382a6cf9963c5f0b2248 to your computer and use it in GitHub Desktop.
class TeamsScreen < PM::GroupedTableScreen
title "NBA Teams"
def table_data
[{
title: "Atlantic",
cells: [
{ title: "Boston Celtics", action: :select_team, arguments: { team: "Boston Celtics" } },
{ title: "Brooklyn Nets", action: :select_team, arguments: { team: "Brooklyn Nets" } },
{ title: "New York Knicks", action: :select_team, arguments: { team: "New York" } },
{ title: "Philadelphia 76ers", action: :select_team, arguments: { team: "Philadelphia 76ers" } },
{ title: "Toronto Raptors", action: :select_team, arguments: { team: "Toronto Raptors" } },
]
}, {
title: "Central",
cells: [
{ title: "Chicago Bulls", action: :select_team, arguments: { team: "Chicago Bulls" } },
{ title: "Cleveland Cavaliers", action: :select_team, arguments: { team: "Cleveland Cavaliers" } },
{ title: "Detroit Pistons", action: :select_team, arguments: { team: "Detroit Pistons" } },
{ title: "Indiana Pacers", action: :select_team, arguments: { team: "Indiana Pacers" } },
{ title: "Milwaukee Bucks", action: :select_team, arguments: { team: "Milwaukee Bucks" } },
]
}, {
title: "Southeast",
cells: [
{ title: "Atlanta Hawks", action: :select_team, arguments: { team: "Atlanta Hawks" } },
{ title: "Charlotte Hornets", action: :select_team, arguments: { team: "Charlotte Hornets" } },
{ title: "Miami Heat", action: :select_team, arguments: { team: "Miami Heat" } },
{ title: "Orlando Magic", action: :select_team, arguments: { team: "Orlando Magic" } },
{ title: "Washington Wizards", action: :select_team, arguments: { team: "Washington Wizards" } },
]
}, {
title: "Northwest",
cells: [
{ title: "Denver Nuggets", action: :select_team, arguments: { team: "Denver Nuggets" } },
{ title: "Minnesota Timberwolves", action: :select_team, arguments: { team: "Minnesota Timberwolves" } },
{ title: "Oklahoma City Thunder", action: :select_team, arguments: { team: "Oklahoma City Thunder" } },
{ title: "Portland Trail Blazers", action: :select_team, arguments: { team: "Portland Trail Blazers" } },
{ title: "Utah Jazz", action: :select_team, arguments: { team: "Utah Jazz" } },
]
}, {
title: "Pacific",
cells: [
{ title: "Golden State Warriors", action: :select_team, arguments: { team: "Golden State Warriors" } },
{ title: "Los Angeles Clippers", action: :select_team, arguments: { team: "Los Angeles Clippers" } },
{ title: "Los Angeles Lakers", action: :select_team, arguments: { team: "Los Angeles Lakers" } },
{ title: "Phoenix Suns", action: :select_team, arguments: { team: "Phoenix Suns" } },
{ title: "Sacramento Kings", action: :select_team, arguments: { team: "Sacramento Kings" } },
]
}, {
title: "Southwest",
cells: [
{ title: "Dallas Mavericks", action: :select_team, arguments: { team: "Dallas Mavericks" } },
{ title: "Houston Rockets", action: :select_team, arguments: { team: "Houston Rockets" } },
{ title: "Memphis Grizzlies", action: :select_team, arguments: { team: "Memphis Grizzlies" } },
{ title: "New Orleans Pelicans", action: :select_team, arguments: { team: "New Orleans Pelicans" } },
{ title: "San Antonio Spurs", action: :select_team, arguments: { team: "San Antonio Spurs" } },
]
}]
end
def select_team(args={})
puts args[:team] # => "Portland Trail Blazers" (when you tap that cell)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment