Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1104597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:30:23+00:00 2026-05-17T01:30:23+00:00

When clicked on the link below, it takes me to the show screen, instead

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:30:23+00:00Added an answer on May 17, 2026 at 1:30 am

    Are you using the Rails Unobtrusive JavaScript (UJS) drivers for Prototype of jQuery?

    In Rails 2.3 the :delete method would setup some JS in the link to send the request as a form post using the delete ‘method’ (via the _method param).

    Now in Rails 3 the inline JS has been removed (thank goodness!) and you will notice that the link has a few new attributes, namely data-method="delete" and, if you are using the confirm option, data-confirm="Your confirmation message".

    The Rails UJS driver, when the page is loaded, looks for any links etc with these attributes and attaches events to them, which then does the same as what the inline javascript would have done.

    If you are using Prototype you can find the UJS file at http://github.com/rails/prototype-ujs, and jQuery at http://github.com/rails/jquery-ujs – just make sure this file is loaded after the JS framework, and before your application.js file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to trigger an event when a link is clicked both by clicking
What is the JavaScript to scroll to the top when a button/link/etc. is clicked?
I want to get the id of the clicked element and then show div
When a ComboBox is clicked this causes it to be selected in the window.
Duplicate Of : Find node clicked under context menu I've got a context menu
When an item is clicked in the checkedlistbox, it gets highlighted. How can I
I have Drupal 5 site where a button is clicked and it calls a
Image a Button on your windows form that does something when being clicked. The
I have a button on an ASP.NET wep application form and when clicked goes
How can I find out which row in a JTable the user just clicked?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.