Modify routes.rb and include the namespaced resources
# File vendor/plugins/ubiquo_core/lib/ubiquo/extensions/rails_generator.rb, line 23
23: def namespaced_route_resources(namespace, *resources)
24: resource_list = resources.map { |r| r.to_sym.inspect }.join(', ')
25: sentinel = "map.namespace :#{namespace} do |#{namespace}|"
26:
27: logger.route "#{namespace}.resources #{resource_list}"
28: unless options[:pretend]
29: gsub_file(
30: 'config/routes.rb',
31: /([\t| ]*)(#{Regexp.escape(sentinel)})/mi,
32: "\\1\\2\n\\1 #{namespace}.resources #{resource_list}\n"
33: )
34: end
35: end
(Not documented)
# File vendor/plugins/ubiquo_core/lib/ubiquo/extensions/rails_generator.rb, line 37
37: def nested_route_resources(parent, *resources)
38: resource_list = resources.map { |r| r.to_sym.inspect }.join(', ')
39:
40: unless options[:pretend]
41: gsub_file(
42: 'config/routes.rb',
43: /^([\ |\t]*)(\w+\.)(resource[s]?\s[\:|\"]#{parent}\"?)(\sdo\s\|#{parent}\|)$/mi,
44: "\\1\\2\\3\\4\n\\1 #{parent}.resources #{resource_list}"
45: )
46: gsub_file(
47: 'config/routes.rb',
48: /^([\ |\t]*)(\w+\.)(resource[s]?\s[\:|\"]#{parent}\"?)$/mi,
49: "\\1\\2\\3 do |#{parent}|\n\\1 #{parent}.resources #{resource_list}\n\\1end"
50: )
51: end
52: end
(Not documented)
# File vendor/plugins/ubiquo_core/lib/ubiquo/extensions/rails_generator.rb, line 64
64: def ubiquo_migration
65: Rake::Task['db:migrate'].execute(nil)
66: end
Add ubiquo tab
# File vendor/plugins/ubiquo_core/lib/ubiquo/extensions/rails_generator.rb, line 55
55: def ubiquo_tab(name)
56: sentinel = 'end # Last tab'
57: unless options[:pretend]
58: gsub_file 'app/views/navigators/_main_navtabs.html.erb', /(#{Regexp.escape(sentinel)})/mi do
59: Ubiquo::tab_template(name)
60: end
61: end
62: end
Disabled; run with $DEBUG to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.