Created
August 5, 2016 17:40
-
-
Save alksl/04f585d2e98e57df15e613143aeb1321 to your computer and use it in GitHub Desktop.
This file contains 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/all" | |
require "rails_admin" | |
class ApplicationController < ActionController::Base | |
end | |
class MyModel < ActiveRecord::Base | |
end | |
class MyApp < Rails::Application | |
routes.append do | |
mount RailsAdmin::Engine => '/admin', as: 'rails_admin' | |
end | |
# Enable cache classes. Production style. | |
config.cache_classes = true | |
config.eager_load = true | |
# uncomment below to display errors | |
config.consider_all_requests_local = true | |
# We need a secret token for session, cookies, etc. | |
config.secret_token = "49837489qkuweoiuoqwehisuakshdjksadh" | |
end | |
RailsAdmin.config do |config| | |
config.included_models = [ | |
"MyModel" | |
] | |
### More at https://github.com/sferik/rails_admin/wiki/Base-configuration | |
config.actions do | |
dashboard # mandatory | |
index # mandatory | |
new | |
export | |
bulk_delete | |
show | |
edit | |
delete | |
show_in_app | |
end | |
end | |
# Initialize the app (originally in config/environment.rb) | |
MyApp.initialize! | |
# Print the stack for fun! | |
puts ">> Starting Rails lightweight stack" | |
Rails.configuration.middleware.each do |middleware| | |
puts "use #{middleware.inspect}" | |
end | |
puts "run #{Rails.application.class.name}.routes" | |
# Run it (originally in config.ru) | |
run MyApp |
This file contains 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
development: | |
adapter: "postgresql" | |
host: "localhost" | |
username: | |
database: | |
port: 5432 |
This file contains 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
source "https://rubygems.org" | |
gem "rails", "~> 4.2" | |
gem "rails_admin" | |
gem "pg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment