Skip to content

Commit

Permalink
fix missing template error and simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
keram authored and ugisozols committed Jul 30, 2012
1 parent a31b2e4 commit c6149b6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pages/app/controllers/refinery/admin/pages_dialogs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def link_to
end

def test_url
result = 'failure'
begin
timeout(5) do
unless params[:url].blank?
Expand All @@ -62,16 +63,16 @@ def test_url
result = case Net::HTTP.get_response(url)
when Net::HTTPSuccess, Net::HTTPRedirection
'success'
else
'failure'
end

render :json => {:result => result}

end
end

rescue
render :json => {:result => 'failure'}
# be quiet
end

render :json => {:result => result}
end

def test_email
Expand Down

0 comments on commit c6149b6

Please sign in to comment.