-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbc74f8
commit 6e14f11
Showing
5 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Gemfile.lock | ||
build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'camping', '<3' | ||
gem 'parklife', path: '../..' | ||
gem 'rack' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require_relative 'camp' | ||
|
||
Parklife.application.configure do |config| | ||
config.app = App | ||
end | ||
|
||
Parklife.application.routes do | ||
root crawl: true | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
require 'camping' | ||
|
||
Camping.goes :App | ||
|
||
module App::Controllers | ||
class Index | ||
def get | ||
render :index | ||
end | ||
end | ||
|
||
class PostsX | ||
def get(id) | ||
@id = id | ||
render :show | ||
end | ||
end | ||
end | ||
|
||
module App::Views | ||
def layout | ||
html do | ||
head { title 'Parklife Camping example' } | ||
body do | ||
self << yield | ||
end | ||
end | ||
end | ||
|
||
def index | ||
ul do | ||
%w(foo bar baz).each do |id| | ||
li do | ||
a(href: "/posts/#{id}") { id } | ||
end | ||
end | ||
end | ||
end | ||
|
||
def show | ||
h1 { @id } | ||
end | ||
end |