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

  • Home
  • SEARCH
  • 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 6348291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:23:27+00:00 2026-05-24T21:23:27+00:00

I am trying to create a multi button form. The if I press create

  • 0

I am trying to create a multi button form. The if I press “create checked” it does create copyies is it is should do. I have created the routes.

My controller:

  def create_multiple
    @webhost = Webhost.find(params[:webhost_ids])
    if params[:delete_button]
     render 'admin/webhosts/delete_multiple'
    else
    @webhost.each do |webhost|
    Webhost.create(webhost.attributes)
    end
    end
    respond_to do |format|
      format.html { redirect_to(:admin_webhosts, :notice => 'Konkurrancerne er nu slettet') }
      format.xml  { head :ok }
    end
end

def delete_multiple
    @webhost = Webhost.find(params[:webhost_ids])
    @webhost.each do |webhost|
    webhost.destroy
    end
    respond_to do |format|
      format.html { redirect_to(:admin_webhosts, :notice => 'Konkurrancerne er nu slettet') }
      format.xml  { head :ok }
    end
end  

In my view I have:

<%= submit_tag "Create Checked" %>  
<%= submit_tag "Delete Checked", :name => 'delete_button' %>  

When I press the delete checked button I get this error:
Template is missing

Missing template admin/webhosts/delete_multiple with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths "C:/Rails/webhostapp/app/views", "C:/Ruby192/lib/ruby/gems/1.9.1/gems/devise-1.1.5/app/views", "C:/Ruby192/lib/ruby/gems/1.9.1/gems/kaminari-0.10.4/app/views", "C:/Rails/webhostapp", "C:/"

And the URL is: http://localhost:3000/admin/webhosts/create_multiple

  • 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-24T21:23:28+00:00Added an answer on May 24, 2026 at 9:23 pm

    If I see correctly, you want to call delete_multiple when the button is clicked.

    If delete_multiple is a method of your controller, you don’t call it via render. render will try to look for a view called admin/webhosts/delete_multiple.html.erb or similar and show that view. See Layouts and Rendering in Rails for more on that.

    What you probably want to do is just call this method as usual:

    def create_multiple
        @webhost = Webhost.find(params[:webhost_ids])
        if params[:delete_button]
         delete_multiple(params) and return
        else
        # ...
    end
    

    Note that you probably need to pass the parameters to your delete_multiple method. You will have to adapt it to take the parameters as an argument of course:

    def delete_multiple(params)
        @webhost = Webhost.find(params[:webhost_ids])
        @webhost.each do |webhost|
        webhost.destroy
        end
        respond_to do |format|
          format.html { redirect_to(:admin_webhosts, :notice => 'Konkurrancerne er nu slettet') }
          format.xml  { head :ok }
        end
    end  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a multi line string in Groovy. I have a
I'm trying to create a multi-level ajax form on my rails app that can
Am trying to simplify the create / edit view for a multi-model controller. User
I'm trying to create a node form for a custom type. I have organic
I am trying to create a multi step form using model classes: my view:
In a multi form .NetCF 3.5 application I'm trying create the forms in the
I am trying to create a multi threaded PHP application right now. I have
I am currently trying to create a multi-page form that uses both jQuery and
I have been searching around for a way to create a multi step form
I have a multi-module maven project, and I'm trying to create an assembly for

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.