Skip to content

Instantly share code, notes, and snippets.

@jonpaul
Created November 17, 2011 17:11
Show Gist options
  • Save jonpaul/1373784 to your computer and use it in GitHub Desktop.
Save jonpaul/1373784 to your computer and use it in GitHub Desktop.
%ul
= @listings.inspect
- @listings.each do |l|
%li
= l
%span= link_to "Delete This Batch", boss_listing_path(l), :method => :delete, :confirm => "Are you SURE you want to delete all listings with this identifier? This cannot be undone."
class Boss::ListingsController < Boss::BaseController
def index
@listings = current_user.organization.try(:listings).try(:distinct, :listing_name)
end
def destroy
@listings = Listing.where(:listing_name => params[:listing_name])
@listings.destroy
redirect_to organizations_url, :notice => "Successfully destroyed this group of listings."
end
end
ActionController::RoutingError in Boss/listings#index
Showing /Users/derek/glide_projects/mdm/app/views/boss/listings/index.html.haml where line #6 raised:
No route matches {:controller=>"boss/listings", :action=>"destroy", :listing_name=>""}
Extracted source (around line #6):
3: - @listings.each do |listing|
4: %li
5: = listing
6: %span= link_to "Delete This Batch", boss_listing_path(:listing_name => "#{listing}"),:method => :delete, :confirm => "Are you SURE you want to delete all listings with this identifier? This cannot be undone."
boss_listings GET /boss/listings(.:format) {:action=>"index", :controller=>"boss/listings"}
boss_listing DELETE /boss/listing/:listing_name(.:format) {:controller=>"boss/listings", :action=>"destroy"}
namespace :boss do
root :to => "base#index"
get 'account' => 'base#account'
resources :users
get 'listings' => 'listings#index'
delete 'listing/:listing_name' => 'listings#destroy', :as => 'listing'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment