Created
February 25, 2009 07:57
-
-
Save pnomolos/70073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Packs | |
module Admin | |
class Grade < Grade | |
# Stub class extending from the real definition | |
end | |
end # Admin | |
end # Packs | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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