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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:18:55+00:00 2026-05-18T12:18:55+00:00

Something is seriously not adding up here.. My page just refreshes, nothing happens, it

  • 0

Something is seriously not adding up here.. My page just refreshes, nothing happens, it never touches any of my debuggers hanging out on all my methods except for index.

my html:

<%- for image in @images %>
  <%= image.attachment_file_name %>

  <%-# link_to_delete image, :url => destroy_image_admin_wysiwyg_path(image.id) %>
  <%= link_to 'delete', { :url => destroy_image_image_path(image.id) },
        #:confirm => 'Are you sure?',
        :post => true
     %>

  <br />
<% end %>

my controller

def destroy_image
  debugger
  @img = Image.find(params[:id])
  @img.destroy
  respond_to do |format|
    format.html { redirect_to admin_image_rotator_path }
  end
end

My routes:

map.resources :images, :member => { :destroy_image => :post }

My disgusting hack that works that I will replace as soon as I find something better

I moved the action over to a simpler controller I built myself.

Changed my routes to :

admin.resources :wysiwygs, :member => { :destroy_image => :post }

Changed my html :

<%= link_to 'delete', :controller => "wysiwygs", :action => "destroy_image" %>

But when I clicked on the link..it brought up.. the show action ?? fffffffffuuuuuuu

I retaliated by just moving my action to the show action, and passing a hidden field in my html..

<%= link_to 'delete', :controller => "wysiwygs", :action => "destroy_image", :hidden_field => {:value =>  image.id} %>

  def show
    # this was previously in destroy_image
    @img = Image.find(params[:hidden_field][:value])
    @img.destroy
    respond_to do |format|
      format.html { redirect_to admin_image_rotator_path }
    end
  end
  • 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-18T12:18:56+00:00Added an answer on May 18, 2026 at 12:18 pm

    It seems you’re going down the wrong path here. If a before_filter is blocking your action, figure out why. Use skip_before_filter :filter_name if the filter is not needed.

    Don’t use show actions or HTTP GET for deletes. Even if it works, it will confuse things down the road. Use a DELETE verb:

    map.resources :images, :member => { :destroy_image => :delete }

    pass it in the link helper:

    <%= link_to "delete", destroy_image_image_path(image), :method => :delete %>
    

    And use ImagesController#destroy_image to perform the action. Better yet, consider using the standard RESTful ImagesController#destroy which map.resources gives you for free.

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

Sidebar

Related Questions

I'm seriously stuck here with something obvious. I have an application that communicates with
Something i've never really done before, but what is the best way to make
Something that would really reload the page or resource, ignoring whatever might be in
Seriously. My hosting company says that there's something wrong with my Php code. I'm
sorry, I did not find something useful when searching google. Very basic question, mainly
Am I doing something wrong, or is this seriously what the developers expect me
I've encountered something very strange, and things just don't add up. First of all,
I want to do something really simple, I just can't seem to find the
Something is seriously wrong with my VS Debugger. I run my application and do
I'm not sure what the best practice is when attempting to do something with

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.