Skip to content

Instantly share code, notes, and snippets.

@Ziaw
Created May 13, 2016 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ziaw/d768ceea44474c6ebf256bfc56c68600 to your computer and use it in GitHub Desktop.
Save Ziaw/d768ceea44474c6ebf256bfc56c68600 to your computer and use it in GitHub Desktop.
custom scaffold slim views rails initializer file
if Rails.env.development?
# copy templates from slim-rails to lib/generators/slim/scaffold/templates and customize
module App
class Application < ::Rails::Application
generators do
require 'generators/slim/scaffold/scaffold_generator'
Slim::Generators::ScaffoldGenerator.class_eval do
source_root File.expand_path('../../../lib/generators/slim/scaffold/templates', __FILE__)
end
end
end
end
end
@Ziaw
Copy link
Author

Ziaw commented May 13, 2016

change App to real app name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment