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 717859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:27:37+00:00 2026-05-14T05:27:37+00:00

I am using rails beta 3 and I have a erb page named index.html.erb

  • 0

I am using rails beta 3 and I have a erb page named index.html.erb for discussions controller. In that page, I have a link as following:

<%= link_to 'Delete', {:action=>'destroy', :id=>@discussion}, :confirm=>"Are you sure", :method=>'post' %>

Which is supposed to generate a link to delete a discussion, however, the generated html is

<a href="/discussions/1" data-confirm="Are you sure" data-method="post" rel="nofollow">Delete</a>

Which always routes to the show action. I think the href should be /discussions/destroy/1. But for some reason it is not.

Any ideas? Thanks in advance.

  • 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-14T05:27:38+00:00Added an answer on May 14, 2026 at 5:27 am

    That is the correct href, but the method should be :delete. You also need to make sure you’re properly set up with the new unobtrusive javascript way of doing things in rails 3. You might need to add the csrf_meta_tag helper, as described in this link:

    http://blog.loopedstrange.com/modest-rubyist-archive/rails-3-ujs-and-csrf-meta-tags

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

Sidebar

Related Questions

Using: Rails 3.1.1 I have a controller/model/view called Category that is built up on
I am using Rails 3 beta 4. I have the following models: class Player
Using Rails v2.1, lets say you have an action for a controller that is
I'm using Rails 3.1 beta with Ruby 1.9.2 and rake 0.9.2, and have a
Using Rails 3. I have the following: # shop.rb SHOP_TYPES = %w(cafe restaurant station)
Now that Rails 3 beta is out, I thought I'd have a look at
I have a Rails app on Heroku using the Postgres 9 beta. I've tried
I'm using Rails 3 Beta and I assume the syntax is similar to the
Using Rails 3.2. I have an individual Shop post, and each shop has reviews.
Using Rails 3.1.3 with Ruby 1.9.3p0. I've discovered that by default, Rails does not

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.