When clicked on the link below, it takes me to the show screen, instead of deleting the thing.
<th><%= link_to 'Destroy', blog, :method => :delete %></th>
Controller
def destroy
@blog = Blog.find(params[:id])
@blog.destroy
respond_to do |format|
format.html { redirect_to(root_path) }
format.xml { head :ok }
end
end
Something must be wrong in my routes. can someone help me find the error?
PremSite::Application.routes.draw do
resources :blogs
resources :portfolios do
member do
get 'show_port'
end
end
get "admin/index"
resources :rosters
#All the static service pages
match "bloggers" => 'dashboard#bloggers'
match "sitemap" => 'dashboard#sitemap'
match "about" => 'dashboard#about'
match "about_team" => 'dashboard#about_team'
match "service" => 'dashboard#service'
match "portfolio" => 'dashboard#portfolio', :as => 'view'
match "contact" => 'dashboard#contact'
match "blogger" => 'dashboard#blogger'
match "admin" => 'admin#index'
match "services/web_development" => 'services#web_development'
match "services/design_brand" => 'services#design_brand'
match "services/flash_solutions" => 'services#flash_solutions'
match "services/ecommerce" => 'services#ecommerce'
match "services/emarket" => 'services#emarket'
match "services/applications" => 'services#applications'
match "services/seo_solutions" => 'services#seo_solutions'
match "services/google_adwords" => 'services#google_adwords'
match "services/google_analytics" => 'services#google_analytics'
match "services/website_evaluation" => 'services#website_evaluation'
match "newsletter/join" => 'newsletter#join'
root :to=> "dashboard#index"
end
Can someone explain where I went wrong? Thanks.