To add a normal resource, do it this way:
class GawingFileableGenerator < Rails::Generator::Base
def manifest
record do |m|
...
m.route_resources :files
end
end
end
If you want to add other stuff like :member or :collection, do it this way
class GawingFileableGenerator < Rails::Generator::Base
def manifest
record do |m|
...
route_string = ":files, :member => { :download => :get }"
def route_string.to_sym; to_s; end
def route_string.inspect; to_s; end
m.route_resources route_string
end
end
end
No comments:
Post a Comment