summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-05-05 02:55:33 +0000
committerGo MAEDA <maeda@farend.jp>2018-05-05 02:55:33 +0000
commitc9a216b81687767d30b847cda007efaa2b1b225b (patch)
treee80d625713db012bb1019eaeb81a445da54998a7 /lib
parent00b85dc8d9a5102c494e32739abac0a836ca125a (diff)
downloadredmine-c9a216b81687767d30b847cda007efaa2b1b225b.tar.gz
redmine-c9a216b81687767d30b847cda007efaa2b1b225b.zip
Fix: redmine_plugin_controller generates camelcase filename (#28668).
Patch by Toru Takahashi. git-svn-id: http://svn.redmine.org/redmine/trunk@17325 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/generators/redmine_plugin_controller/redmine_plugin_controller_generator.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/generators/redmine_plugin_controller/redmine_plugin_controller_generator.rb b/lib/generators/redmine_plugin_controller/redmine_plugin_controller_generator.rb
index 9c42d938b..16a820ebf 100644
--- a/lib/generators/redmine_plugin_controller/redmine_plugin_controller_generator.rb
+++ b/lib/generators/redmine_plugin_controller/redmine_plugin_controller_generator.rb
@@ -14,12 +14,12 @@ class RedminePluginControllerGenerator < Rails::Generators::NamedBase
end
def copy_templates
- template 'controller.rb.erb', "#{plugin_path}/app/controllers/#{controller}_controller.rb"
- template 'helper.rb.erb', "#{plugin_path}/app/helpers/#{controller}_helper.rb"
- template 'functional_test.rb.erb', "#{plugin_path}/test/functional/#{controller}_controller_test.rb"
+ template 'controller.rb.erb', "#{plugin_path}/app/controllers/#{controller.underscore}_controller.rb"
+ template 'helper.rb.erb', "#{plugin_path}/app/helpers/#{controller.underscore}_helper.rb"
+ template 'functional_test.rb.erb', "#{plugin_path}/test/functional/#{controller.underscore}_controller_test.rb"
# View template for each action.
actions.each do |action|
- path = "#{plugin_path}/app/views/#{controller}/#{action}.html.erb"
+ path = "#{plugin_path}/app/views/#{controller.underscore}/#{action}.html.erb"
@action_name = action
template 'view.html.erb', path
end