forked from Ada-C7/api-muncher
-
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.
made basic show page but still in the middle of changing routes to fi…
…x index
- Loading branch information
1 parent
93b60ef
commit fb550cc
Showing
6 changed files
with
34 additions
and
5 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
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,3 @@ | ||
<h2><%= @recipe.label %></h2> | ||
|
||
<%= image_tag @recipe.image, alt: @recipe.label %> |
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,6 +1,6 @@ | ||
Rails.application.routes.draw do | ||
root 'home#index' | ||
|
||
get '/recipes/:search', to: 'recipes#index', as: 'recipes' | ||
get '/recipes', to: 'recipes#index', as: 'recipes' | ||
get '/recipes/:uri', to: 'recipes#show', as: 'recipe' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
class Recipe | ||
attr_reader :label, :uri | ||
attr_reader :label, :uri, :image | ||
|
||
def initialize(label, id, options= {}) | ||
def initialize(label, uri, image, options = {}) | ||
@label = label | ||
@uri = uri | ||
@image = image | ||
end | ||
end |