-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
formatting for reading, fixed error with user_id, made helper to remo…
…ve some logic out of the way
- Loading branch information
Showing
3 changed files
with
29 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
module RecipesHelper | ||
def is_owner? | ||
if current_user.id == @recipe.user_id then | ||
return true | ||
else | ||
return false | ||
end | ||
def is_owner? | ||
if current_user.id == @recipe.user_id then | ||
return true | ||
else | ||
return false | ||
end | ||
end | ||
|
||
def displayGravator?(user) | ||
link_to gravatar_for(user, size: 100), user_path(user) unless user.nil? | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<%= link_to gravatar_for(user, size: 100), user_path(user) %> | ||
<%= displayGravator?(user) %> | ||
<h5> User name: <%= user.first_name %></h5> |
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