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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:23:35+00:00 2026-05-14T04:23:35+00:00

I want to have a delete user link in a normal Activerecord table, but

  • 0

I want to have a “delete user” link in a normal Activerecord table, but I can’t figure out how to wrangle the inline ruby in haml.

I have this:

   %tbody
    - @users.each do |user|
      %tr
        %td= user.name
        %td= user.login
        %td
          %a
            %img{:src => '../images/delete.png', :title => 'Delete user'}

How do I make the

- user.destroy

be a clickable link in Haml?

  • 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-14T04:23:35+00:00Added an answer on May 14, 2026 at 4:23 am

    I think you want

    %tbody
     - @users.each do |user|
       %tr
         %td= user.name
         %td= user.login
         %td
           = link_to image_tag('delete.png', :title => "Delete #{user}"), user_path(user), :method => :delete)
    

    See ActionView::Helpers::UrlHelper#link_to

    Or, if you’re not using ActionPack,

    %tbody
      - @users.each do |user|
        %tr
          %td= user.name
          %td= user.login
          %td
            %a{:href => "/users/#{user.id}?_method=delete"}
              %img{:src => '/images/delete.png', :title => "Delete #{user}"}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have list of rows that user select and i want to delete them,
I want to have an 'updateinfo' table in order to record every update/insert/delete operations
I have two tables users registered_members I want to confirm values from user table
I have database application, I want to allow the user to restore the deleted
I have a delete button on my web site which I want to add
I want to have a web based admin to upload, delete files and folders
i have a custom cell i want to delete it when a button is
I have a html document and I want to delete all the divs of
EDIT: I don't want to delete the post because I have learned a lot
I have several wpf pages with update/delete/add buttons. I want to display to the

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.