This repository has been archived by the owner on Jul 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Serve Lookbooks and Projects without DB
- Loading branch information
1 parent
d5b3ef9
commit bd9a514
Showing
36 changed files
with
85 additions
and
33 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,78 @@ | ||
class ProjectsController < InheritedResources::Base | ||
def index | ||
@projects = Project.all | ||
@projects = find_projects | ||
|
||
render json: @projects, serializer: CachedCollectionSerializer | ||
render json: { projects: @projects } | ||
end | ||
|
||
private | ||
|
||
def find_projects | ||
[{ | ||
id: 1, | ||
name: "The Philadelphia Experiment", | ||
numeral: "I", | ||
slug: "the-philadelphia-experiment", | ||
pages: [ | ||
{ url: image_url("the-philadelphia-experiment/1.jpg") }, | ||
{ url: image_url("the-philadelphia-experiment/2.jpg") }, | ||
{ url: image_url("the-philadelphia-experiment/3.jpg") }, | ||
{ url: image_url("the-philadelphia-experiment/4.jpg") }, | ||
{ url: image_url("the-philadelphia-experiment/5.jpg") }, | ||
{ url: image_url("the-philadelphia-experiment/6.jpg") }, | ||
{ url: image_url("the-philadelphia-experiment/7.jpg") }, | ||
{ url: image_url("the-philadelphia-experiment/8.jpg") }, | ||
{ url: image_url("the-philadelphia-experiment/9.jpg") }, | ||
{ url: image_url("the-philadelphia-experiment/10.jpg") }, | ||
{ url: vimeo_url(61014435), is_video: true }, | ||
{ url: image_url("the-philadelphia-experiment/12.jpg") }, | ||
] | ||
}, { | ||
id: 2, | ||
name: "Zachary Armstrong", | ||
numeral: "II", | ||
slug: "zachary-armstrong", | ||
pages: [ | ||
{ url: image_url("zachary-armstrong/1.jpg") }, | ||
{ url: image_url("zachary-armstrong/2.jpg") }, | ||
{ url: image_url("zachary-armstrong/3.jpg") }, | ||
{ url: image_url("zachary-armstrong/4.jpg") }, | ||
{ url: image_url("zachary-armstrong/5.jpg") }, | ||
{ url: image_url("zachary-armstrong/6.jpg") }, | ||
{ url: image_url("zachary-armstrong/7.jpg") }, | ||
{ url: image_url("zachary-armstrong/8.jpg") }, | ||
{ url: image_url("zachary-armstrong/9.jpg") }, | ||
{ url: vimeo_url(86785302), is_video: true }, | ||
{ url: image_url("zachary-armstrong/11.jpg") }, | ||
] | ||
}, { | ||
id: 3, | ||
name: "Magenta", | ||
numeral: "III", | ||
slug: "magenta", | ||
pages: [ | ||
{ url: image_url("magenta/1.jpg") }, | ||
{ url: image_url("magenta/2.jpg") }, | ||
{ url: image_url("magenta/3.jpg") }, | ||
{ url: image_url("magenta/4.jpg") }, | ||
{ url: image_url("magenta/5.jpg") }, | ||
{ url: vimeo_url(90116548), is_video: true }, | ||
{ url: image_url("magenta/7.jpg") }, | ||
{ url: image_url("magenta/8.jpg") }, | ||
{ url: image_url("magenta/9.jpg") }, | ||
{ url: image_url("magenta/10.jpg") }, | ||
{ url: image_url("magenta/11.jpg") }, | ||
{ url: vimeo_url(93339618), is_video: true }, | ||
{ url: image_url("magenta/13.jpg") }, | ||
] | ||
}] | ||
end | ||
|
||
def image_url(name) | ||
self.class.helpers.image_url("projects/#{name}") | ||
end | ||
|
||
def vimeo_url(id) | ||
"http://player.vimeo.com/video/#{id}?title=0&byline=0&portrait=0&color=cfcfcf%22%20width=%22888" | ||
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
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 |
---|---|---|
@@ -1,45 +1,29 @@ | ||
{ | ||
"type": "object", | ||
"required": ["projects", "photos"], | ||
"required": ["projects"], | ||
"properties": { | ||
"projects": { | ||
"type": "array", | ||
"items": { | ||
"required": [ | ||
"id", | ||
"name", | ||
"video_url", | ||
"published_at", | ||
"photo_ids" | ||
"pages", | ||
"slug" | ||
], | ||
"properties" : { | ||
"id": { "type": "integer" }, | ||
"name": { "type": "string" }, | ||
"video_url": { "type": "string" }, | ||
"published_at": { "type": "string", "format": "date-time" }, | ||
"photo_ids": { "type": "array" }, | ||
"banner": { "type": "string" }, | ||
"banner_hover": { "type": "string" } | ||
} | ||
} | ||
}, | ||
"photos": { | ||
"type": "array", | ||
"items": { | ||
"required": [ | ||
"id", | ||
"url", | ||
"caption", | ||
"thumbnail" | ||
], | ||
"properties" : { | ||
"id": { "type": "integer" }, | ||
"url": { "type": "string" }, | ||
"caption": { "type": "string" }, | ||
"thumbnail": { "type": "string" } | ||
"slug": { "type": "string" }, | ||
"pages": { | ||
"type": "array", | ||
"items": { | ||
"url": { "type": "string" }, | ||
"is_video": { "type": "boolean" } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|