Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
changed to show rubyforge search if there is no url
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahoul Baruah committed Feb 4, 2009
1 parent 06a87a1 commit 7be3eb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/helpers/codes_helper.rb
@@ -1,9 +1,9 @@
module CodesHelper
def homepage_link_for code
if code.has_homepage_url?
"<a href=\"#{code.homepage}\">#{h(code.name)}</a>"
"<a href=\"#{code.homepage}\">#{h(code.homepage)}</a>"
else
code.name
"<a href=\"http://rubyforge.org/search/?type_of_search=soft&search=search&words=#{code.name}\">Rubyforge search (#{h(code.name)})</a>"
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/codes/show.html.erb
Expand Up @@ -5,7 +5,7 @@

<dl>
<dt>URL</dt>
<dd><%= link_to @code.homepage, @code.homepage %> </dd>
<dd><%= homepage_link_for @code %> </dd>
<dt>Author(s)</dt>
<dd><%= h @code.author_names %></dd>
<dt>Summary</dt>
Expand Down

0 comments on commit 7be3eb7

Please sign in to comment.