Copy and paste this code into your terminal
DISCLAIMER: You should always review templates before running them. By running the template, you are agreeing to the terms of use.
The contents of this script as show. Any updates will be reflected in the below code and the snippet.
gem 'administrate'
run 'bundle install'
run 'DISABLE_SPRING=true rails g administrate:install'
helper = <<-RUBY # Expose our application's helpers to Administrate config.to_prepare do Administrate::ApplicationController.helper #{Rails.application.class.module_parent_name.camelize}::Application.helpers end RUBY
environment helper + "\n" append_to_file "app/assets/config/manifest.js", "//= link administrate/application.css\n//= link administrate/application.js"
gsub_file 'app/controllers/admin/application_controller.rb', /# TODO Add authentication logic here\./, "redirect_to '/', alert: 'Not authorized.' unless user_signed_in? && current_user.admin?"
A place where you can thank the author, post problems, give constructive feedback, etc. Be nice!