Created
November 11, 2017 21:35
-
-
Save ugisozols/98ff736514cc0edf4e2d25ffc1c6a257 to your computer and use it in GitHub Desktop.
no argument named 'user_names'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# src/pages/base_page.cr | |
abstract class BasePage | |
include LuckyWeb::HTMLPage | |
def render | |
html lang: "en" do | |
head do | |
utf8_charset | |
title page_title | |
css_link asset("css/app.css") | |
js_link asset("js/app.js") | |
end | |
body do | |
inner | |
end | |
end | |
end | |
abstract def inner | |
def page_title | |
"Default title" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# src/pages/users/index_page.cr | |
class Users::IndexPage < BasePage | |
needs user_names : Array(String) | |
def inner | |
ul class: "my-user-list" do | |
@user_names.each do |name| | |
li name, class: "user-name" | |
end | |
end | |
end | |
def page_title | |
"List of users" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# src/actions/users/index.cr | |
class Users::Index < BrowserAction | |
action do | |
render user_names: ["Paul", "Sally", "Jane"] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Getting: