Skip to content

Instantly share code, notes, and snippets.

@paulcsmith
Last active July 30, 2018 14:09
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 paulcsmith/5b6fe1dd7d138669a410f7f704d64283 to your computer and use it in GitHub Desktop.
Save paulcsmith/5b6fe1dd7d138669a410f7f704d64283 to your computer and use it in GitHub Desktop.
class Users::IndexPage < MainLayout
needs users : UserQuery
def content
render_new_user_button
render_users_list
end
def render_new_user_button
link "New User", to: Users::New
end
def render_users_list
ul do
@users.each do |user|
li do
link user.name, to: Users::Show.with(user)
text " - "
text user.age || "no age given"
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment