Last active
December 13, 2015 19:08
-
-
Save arjan0307/4960215 to your computer and use it in GitHub Desktop.
Controller extension
This file contains hidden or 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
<% if namespaced? -%> | |
require_dependency "<%= namespaced_path %>/application_controller" | |
<% end -%> | |
<% module_namespacing do -%> | |
class <%= class_name %>Controller < CustomController | |
<% actions.each do |action| -%> | |
def <%= action %> | |
end | |
<%= "\n" unless action == actions.last -%> | |
<% end -%> | |
end | |
<% end -%> |
This file contains hidden or 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
require 'rails/generators/rails/controller/controller_generator' | |
class CustomControllerGenerator < Rails::Generators::ControllerGenerator | |
source_root File.expand_path('../templates', __FILE__) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment