Skip to content

Commit

Permalink
added delete functionality for the crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
Shailesh Patil committed Feb 5, 2010
1 parent 484f10b commit 4d00398
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions app/controllers/admin/crawlers_controller.rb
Expand Up @@ -35,4 +35,9 @@ def enable
redirect_to admin_crawlers_path(:scope => params[:scope])
end

def destroy
Crawler.find(params[:id]).destroy
redirect_to admin_crawlers_path
end

end
10 changes: 5 additions & 5 deletions app/views/admin/crawlers/index.html.erb
Expand Up @@ -28,22 +28,22 @@
<td align="center" valign="middle"><%= crawler.name %></td>
<td align="center" valign="middle">
<% if crawler.is_enabled %>
<%= link_to image_tag("right.jpg", :alt => "Enabled", :border => 0, :title => "Disable"), enable_admin_crawler_path(crawler, :scope => params[:scope], :state => false) %>
<%= link_to image_tag("right.jpg", :alt => "Enabled", :border => 0, :title => "Disable"), enable_admin_crawler_path(crawler, :state => false) %>
<% else %>
<%= link_to image_tag("cross.jpg", :alt => "Enabled", :border => 0, :title => "Enable"), enable_admin_crawler_path(crawler,:scope => params[:scope], :state => true) %>
<%= link_to image_tag("cross.jpg", :alt => "Enabled", :border => 0, :title => "Enable"), enable_admin_crawler_path(crawler, :state => true) %>
<% end %>
</td>
<td align="center" valign="middle" class="tablelinks">
<%= link_to "Edit", edit_admin_crawler_path(crawler, :scope => params[:scope]) %>|
<%= link_to "Delete", admin_crawler_path(crawler, :scope => params[:scope]), :method => "delete" %>
<%= link_to "Edit", edit_admin_crawler_path(crawler) %>|
<%= link_to "Delete", admin_crawler_path(crawler), :method => "delete" %>
</td>
</tr>
<% end %>
</table>
<%= will_paginate @crawlers %>
<br/>
<div class="greenbut" style="margin-left:270px;">
<%= link_to "Add New", new_admin_crawler_path(:scope => params[:scope]), :rel => "#overlay10" %>
<%= link_to "Add New", new_admin_crawler_path, :rel => "#overlay10" %>
</div>
<br/>
<br/>
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/home.html.erb
Expand Up @@ -3,6 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="keywords" content= "<%= @page.keywords if @page %>" />
<meta name="description" content= "<%= @page.keywords if @page %>" />
<title><%= @category.display_name + ' - ' if @category%> <%= @page.title + ' | 'if @page %><%= @site.company_name if @site %></title>
<link href="/stylesheets/ejoshweb<%= $THEME %>/css/layout.css" rel="stylesheet" type="text/css" />
<link href="/stylesheets/ejoshweb<%= $THEME %>/css/<%= $COLOR %>.css" rel="stylesheet" type="text/css" />
Expand Down

0 comments on commit 4d00398

Please sign in to comment.