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