diff --git a/app/controllers/contracts_controller.rb b/app/controllers/contracts_controller.rb index 92fb479..555c7e7 100644 --- a/app/controllers/contracts_controller.rb +++ b/app/controllers/contracts_controller.rb @@ -1,4 +1,5 @@ -class ContractsController < ApplicationController +class ContractsController < InheritedResources::Base unloadable + respond_to :html end diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..ec8da28 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,3 @@ +ActionController::Routing::Routes.draw do |map| + map.resources :contracts +end diff --git a/init.rb b/init.rb index 16d2d41..73cd1a9 100644 --- a/init.rb +++ b/init.rb @@ -11,3 +11,10 @@ Redmine::Plugin.register :redmine_contracts do requires_redmine :version_or_higher => '0.9.0' requires_redmine_plugin :redmine_rate, :version_or_higher => '0.1.0' end + +require 'dispatcher' +Dispatcher.to_prepare :redmine_contracts do + gem 'inherited_resources', :version => '1.0.6' + require_dependency 'inherited_resources' + require_dependency 'inherited_resources/base' +end