Skip to content

Instantly share code, notes, and snippets.

@pnomolos
Created February 25, 2009 07:57
Show Gist options
  • Save pnomolos/70073 to your computer and use it in GitHub Desktop.
Save pnomolos/70073 to your computer and use it in GitHub Desktop.
module Packs
module Admin
class Grade < Grade
# Stub class extending from the real definition
end
end # Admin
end # Packs
%table
%tr
- for grade in @grades
%tr
%td
= grade.name
%td
= link_to 'Show', resource(grade.school, grade) # This fails because grade.class.to_s is Packs::Admin::Grade rather than just Grade as the router is expecting
%td
= link_to 'Edit', resource(grade.school, grade, :edit)
%td
= delete_button(resource(grade.school, grade), 'Delete')
match('/admin', :sub => 'packs').to(:namespace => 'packs/admin') do |admin|
admin.resources :schools, { :name_prefix => :admin } do |schools|
schools.resources :grades do |grades|
grades.resources :packs
end
end
admin.resources :pack_products
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment