-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display timestamps on the program page, and output program titles with '.titleize'
- Loading branch information
Showing
4 changed files
with
15 additions
and
11 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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
module ProgramsHelper | ||
# def program_link program_name, program_slug, username | ||
# "#{link_to(program_name, user_program_path(username, program_slug))} by #{link_to(username, user_path(username))}".html_safe | ||
# end | ||
def program_link program | ||
"#{link_to(program.title, user_program_path(program.author_username, program))}".html_safe | ||
"#{link_to(program.title.titleize, user_program_path(program.author_username, program))}".html_safe | ||
end | ||
|
||
def author_link username | ||
"#{link_to(username, user_path(username))}".html_safe | ||
def author_link username, program = nil | ||
output = "" | ||
output += link_to(username, user_path(username)) | ||
|
||
if program | ||
output += ", #{program.created_at.strftime('%m/%d/%y')}" unless program.created_at.nil? | ||
end | ||
|
||
output.html_safe | ||
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