Skip to content

Instantly share code, notes, and snippets.

@CodePint
Created May 30, 2018 15:07
Show Gist options
  • Save CodePint/de576891dd2889e90ae820fa451d6fa8 to your computer and use it in GitHub Desktop.
Save CodePint/de576891dd2889e90ae820fa451d6fa8 to your computer and use it in GitHub Desktop.
def create_controller_files
if file_name.pluralize.singularize == file_name
puts "*** Warning this is a singular file name, convention dictactes plural names be used for controllers *** "
else
puts "plural file_name confirmed"
end
template "controller.rb", File.join("app/controllers", class_path, "#{file_name}_controller.rb")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment