adminscaffold 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +34 -0
  5. data/lib/admin_scaffold/version.rb +3 -0
  6. data/lib/admin_scaffold.rb +6 -0
  7. data/lib/adminscaffold.rb +1 -0
  8. data/lib/generators/admin_scaffold/admin_scaffold_generator.rb +24 -0
  9. data/lib/generators/admin_scaffold/install_generator.rb +19 -0
  10. data/lib/generators/admin_scaffold/templates/admin.css +4 -0
  11. data/lib/generators/admin_scaffold/templates/admin.html.erb.tt +14 -0
  12. data/lib/generators/admin_scaffold/templates/admin.js +4 -0
  13. data/lib/generators/admin_scaffold/templates/admin_controller.rb +3 -0
  14. data/lib/tasks/admin_scaffold_tasks.rake +4 -0
  15. data/test/admin_scaffold_test.rb +7 -0
  16. data/test/dummy/README.rdoc +28 -0
  17. data/test/dummy/Rakefile +6 -0
  18. data/test/dummy/app/assets/javascripts/admin/books.js +2 -0
  19. data/test/dummy/app/assets/javascripts/admin.js +4 -0
  20. data/test/dummy/app/assets/javascripts/application.js +13 -0
  21. data/test/dummy/app/assets/stylesheets/admin/books.css +4 -0
  22. data/test/dummy/app/assets/stylesheets/admin.css +4 -0
  23. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  24. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  25. data/test/dummy/app/controllers/admin/books_controller.rb +58 -0
  26. data/test/dummy/app/controllers/admin_controller.rb +3 -0
  27. data/test/dummy/app/controllers/application_controller.rb +5 -0
  28. data/test/dummy/app/helpers/admin/books_helper.rb +2 -0
  29. data/test/dummy/app/helpers/application_helper.rb +2 -0
  30. data/test/dummy/app/models/admin/book.rb +2 -0
  31. data/test/dummy/app/models/book.rb +2 -0
  32. data/test/dummy/app/views/admin/books/_form.html.erb +29 -0
  33. data/test/dummy/app/views/admin/books/edit.html.erb +6 -0
  34. data/test/dummy/app/views/admin/books/index.html.erb +31 -0
  35. data/test/dummy/app/views/admin/books/new.html.erb +5 -0
  36. data/test/dummy/app/views/admin/books/show.html.erb +19 -0
  37. data/test/dummy/app/views/layouts/admin.html.erb +14 -0
  38. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  39. data/test/dummy/bin/bundle +3 -0
  40. data/test/dummy/bin/rails +4 -0
  41. data/test/dummy/bin/rake +4 -0
  42. data/test/dummy/bin/setup +29 -0
  43. data/test/dummy/config/application.rb +26 -0
  44. data/test/dummy/config/boot.rb +5 -0
  45. data/test/dummy/config/database.yml +85 -0
  46. data/test/dummy/config/environment.rb +5 -0
  47. data/test/dummy/config/environments/development.rb +41 -0
  48. data/test/dummy/config/environments/production.rb +79 -0
  49. data/test/dummy/config/environments/test.rb +42 -0
  50. data/test/dummy/config/initializers/assets.rb +12 -0
  51. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  52. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  53. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  54. data/test/dummy/config/initializers/inflections.rb +16 -0
  55. data/test/dummy/config/initializers/mime_types.rb +4 -0
  56. data/test/dummy/config/initializers/session_store.rb +3 -0
  57. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  58. data/test/dummy/config/locales/en.yml +23 -0
  59. data/test/dummy/config/routes.rb +60 -0
  60. data/test/dummy/config/secrets.yml +22 -0
  61. data/test/dummy/config.ru +4 -0
  62. data/test/dummy/db/migrate/20150205063647_create_books.rb +11 -0
  63. data/test/dummy/db/schema.rb +27 -0
  64. data/test/dummy/log/development.log +122 -0
  65. data/test/dummy/log/test.log +156 -0
  66. data/test/dummy/public/404.html +67 -0
  67. data/test/dummy/public/422.html +67 -0
  68. data/test/dummy/public/500.html +66 -0
  69. data/test/dummy/public/favicon.ico +0 -0
  70. data/test/dummy/test/fixtures/books.yml +11 -0
  71. data/test/dummy/test/models/book_test.rb +7 -0
  72. data/test/dummy/tmp/cache/assets/development/sprockets/01abf17de4892ee0547ad83c30695a01 +0 -0
  73. data/test/dummy/tmp/cache/assets/development/sprockets/0e2a64fc0b20a44edef0e893fe02bb8b +0 -0
  74. data/test/dummy/tmp/cache/assets/development/sprockets/27184889e78dc5a556f3c7567afbef63 +0 -0
  75. data/test/dummy/tmp/cache/assets/development/sprockets/28d0ee5d51a1686dbfab844d57224241 +0 -0
  76. data/test/dummy/tmp/cache/assets/development/sprockets/3b33c918bc770b5c08f9a754758bc4e6 +0 -0
  77. data/test/dummy/tmp/cache/assets/development/sprockets/5953ddd4e0ec1b5b73fbed29804c11b3 +0 -0
  78. data/test/dummy/tmp/cache/assets/development/sprockets/5d4bd56a9d4de4d2e6d0cfb68c8af8e8 +0 -0
  79. data/test/dummy/tmp/cache/assets/development/sprockets/6609ee9da4eaea9b8d8137fbcfce6fdd +0 -0
  80. data/test/dummy/tmp/cache/assets/development/sprockets/6f2cc8e9b9b8a6b61af4dd957ad61f3e +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sprockets/7aa90d1a0cd25a99c81ace73df870a64 +0 -0
  82. data/test/dummy/tmp/cache/assets/development/sprockets/7cc8464f262e75d9f3d931e2616dd878 +0 -0
  83. data/test/dummy/tmp/cache/assets/development/sprockets/86bf772f4327364a1dad3a4b3051c844 +0 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/9085b07723908dd6995971c4f3c933ad +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/97a02c0a737b9c49960349900e5474c3 +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/b660bba6001bad109fa661da993b1414 +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/cc70a8a06744e45cd5d774b3f5760aea +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/d125916fa47fe25c811ff41c3e47b1dc +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/e2c4bbeb230c9445cd39fac60f905174 +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/f6db94d89ef810b760500ac4d6d7f631 +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/f8160f91b680b2f94df78cefd5abc06e +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/fdcd9c4f2824a62f9858c5b88e2f8185 +0 -0
  93. data/test/dummy/tmp/pids/server.pid +1 -0
  94. data/test/test_helper.rb +18 -0
  95. metadata +245 -0
@@ -0,0 +1,85 @@
1
+ # PostgreSQL. Versions 8.2 and up are supported.
2
+ #
3
+ # Install the pg driver:
4
+ # gem install pg
5
+ # On OS X with Homebrew:
6
+ # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7
+ # On OS X with MacPorts:
8
+ # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9
+ # On Windows:
10
+ # gem install pg
11
+ # Choose the win32 build.
12
+ # Install PostgreSQL and put its /bin directory on your path.
13
+ #
14
+ # Configure Using Gemfile
15
+ # gem 'pg'
16
+ #
17
+ default: &default
18
+ adapter: postgresql
19
+ encoding: unicode
20
+ # For details on connection pooling, see rails configuration guide
21
+ # http://guides.rubyonrails.org/configuring.html#database-pooling
22
+ pool: 5
23
+
24
+ development:
25
+ <<: *default
26
+ database: dummy_development
27
+
28
+ # The specified database role being used to connect to postgres.
29
+ # To create additional roles in postgres see `$ createuser --help`.
30
+ # When left blank, postgres will use the default role. This is
31
+ # the same name as the operating system user that initialized the database.
32
+ #username: dummy
33
+
34
+ # The password associated with the postgres role (username).
35
+ #password:
36
+
37
+ # Connect on a TCP socket. Omitted by default since the client uses a
38
+ # domain socket that doesn't need configuration. Windows does not have
39
+ # domain sockets, so uncomment these lines.
40
+ #host: localhost
41
+
42
+ # The TCP port the server listens on. Defaults to 5432.
43
+ # If your server runs on a different port number, change accordingly.
44
+ #port: 5432
45
+
46
+ # Schema search path. The server defaults to $user,public
47
+ #schema_search_path: myapp,sharedapp,public
48
+
49
+ # Minimum log levels, in increasing order:
50
+ # debug5, debug4, debug3, debug2, debug1,
51
+ # log, notice, warning, error, fatal, and panic
52
+ # Defaults to warning.
53
+ #min_messages: notice
54
+
55
+ # Warning: The database defined as "test" will be erased and
56
+ # re-generated from your development database when you run "rake".
57
+ # Do not set this db to the same as development or production.
58
+ test:
59
+ <<: *default
60
+ database: dummy_test
61
+
62
+ # As with config/secrets.yml, you never want to store sensitive information,
63
+ # like your database password, in your source code. If your source code is
64
+ # ever seen by anyone, they now have access to your database.
65
+ #
66
+ # Instead, provide the password as a unix environment variable when you boot
67
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
68
+ # for a full rundown on how to provide these environment variables in a
69
+ # production deployment.
70
+ #
71
+ # On Heroku and other platform providers, you may have a full connection URL
72
+ # available as an environment variable. For example:
73
+ #
74
+ # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
75
+ #
76
+ # You can use this database configuration with:
77
+ #
78
+ # production:
79
+ # url: <%= ENV['DATABASE_URL'] %>
80
+ #
81
+ production:
82
+ <<: *default
83
+ database: dummy_production
84
+ username: dummy
85
+ password: <%= ENV['DUMMY_DATABASE_PASSWORD'] %>
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,41 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger.
20
+ config.active_support.deprecation = :log
21
+
22
+ # Raise an error on page load if there are pending migrations.
23
+ config.active_record.migration_error = :page_load
24
+
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
28
+ config.assets.debug = true
29
+
30
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31
+ # yet still be able to expire them through the digest params.
32
+ config.assets.digest = true
33
+
34
+ # Adds additional error checking when serving assets at runtime.
35
+ # Checks for improperly declared sprockets dependencies.
36
+ # Raises helpful error messages.
37
+ config.assets.raise_runtime_errors = true
38
+
39
+ # Raises error for missing translations
40
+ # config.action_view.raise_on_missing_translations = true
41
+ end
@@ -0,0 +1,79 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like
20
+ # NGINX, varnish or squid.
21
+ # config.action_dispatch.rack_cache = true
22
+
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26
+
27
+ # Compress JavaScripts and CSS.
28
+ config.assets.js_compressor = :uglifier
29
+ # config.assets.css_compressor = :sass
30
+
31
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
32
+ config.assets.compile = false
33
+
34
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35
+ # yet still be able to expire them through the digest params.
36
+ config.assets.digest = true
37
+
38
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39
+
40
+ # Specifies the header that your server uses for sending files.
41
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43
+
44
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
+ # config.force_ssl = true
46
+
47
+ # Use the lowest log level to ensure availability of diagnostic information
48
+ # when problems arise.
49
+ config.log_level = :debug
50
+
51
+ # Prepend all log lines with the following tags.
52
+ # config.log_tags = [ :subdomain, :uuid ]
53
+
54
+ # Use a different logger for distributed setups.
55
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56
+
57
+ # Use a different cache store in production.
58
+ # config.cache_store = :mem_cache_store
59
+
60
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61
+ # config.action_controller.asset_host = 'http://assets.example.com'
62
+
63
+ # Ignore bad email addresses and do not raise email delivery errors.
64
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
65
+ # config.action_mailer.raise_delivery_errors = false
66
+
67
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68
+ # the I18n.default_locale when a translation cannot be found).
69
+ config.i18n.fallbacks = true
70
+
71
+ # Send deprecation notices to registered listeners.
72
+ config.active_support.deprecation = :notify
73
+
74
+ # Use default logging formatter so that PID and timestamp are not suppressed.
75
+ config.log_formatter = ::Logger::Formatter.new
76
+
77
+ # Do not dump schema after migrations.
78
+ config.active_record.dump_schema_after_migration = false
79
+ end
@@ -0,0 +1,42 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static file server for tests with Cache-Control for performance.
16
+ config.serve_static_files = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Randomize the order test cases are executed.
35
+ config.active_support.test_order = :random
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+ end
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
+ # Rails.application.config.assets.precompile += %w( search.js )Rails.application.config.assets.precompile += %w[admin.js admin.css]
12
+ Rails.application.config.assets.precompile += %w[admin.js admin.css]
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,60 @@
1
+ Rails.application.routes.draw do
2
+ namespace :admin do
3
+ resources :books
4
+ end
5
+
6
+ # The priority is based upon order of creation: first created -> highest priority.
7
+ # See how all your routes lay out with "rake routes".
8
+
9
+ # You can have the root of your site routed with "root"
10
+ # root 'welcome#index'
11
+
12
+ # Example of regular route:
13
+ # get 'products/:id' => 'catalog#view'
14
+
15
+ # Example of named route that can be invoked with purchase_url(id: product.id)
16
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
17
+
18
+ # Example resource route (maps HTTP verbs to controller actions automatically):
19
+ # resources :products
20
+
21
+ # Example resource route with options:
22
+ # resources :products do
23
+ # member do
24
+ # get 'short'
25
+ # post 'toggle'
26
+ # end
27
+ #
28
+ # collection do
29
+ # get 'sold'
30
+ # end
31
+ # end
32
+
33
+ # Example resource route with sub-resources:
34
+ # resources :products do
35
+ # resources :comments, :sales
36
+ # resource :seller
37
+ # end
38
+
39
+ # Example resource route with more complex sub-resources:
40
+ # resources :products do
41
+ # resources :comments
42
+ # resources :sales do
43
+ # get 'recent', on: :collection
44
+ # end
45
+ # end
46
+
47
+ # Example resource route with concerns:
48
+ # concern :toggleable do
49
+ # post 'toggle'
50
+ # end
51
+ # resources :posts, concerns: :toggleable
52
+ # resources :photos, concerns: :toggleable
53
+
54
+ # Example resource route within a namespace:
55
+ # namespace :admin do
56
+ # # Directs /admin/products/* to Admin::ProductsController
57
+ # # (app/controllers/admin/products_controller.rb)
58
+ # resources :products
59
+ # end
60
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 0cd9b30c8b98122787db7fedadfb1016846373773a1215342a4b3f4009aea76c8f5a0c0fd9aa82a0bbf314d3f77d36082d48348f24fe4cddf837f05e2faee94e
15
+
16
+ test:
17
+ secret_key_base: 30a583707741435ba4f73681a64e4c4846ca9038ec196feb7ff7eda5522b0621cfad5bba7234ee70e3d3be3b2c7b057414e1ad3a35346ab6a9fc0121800a7db7
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,11 @@
1
+ class CreateBooks < ActiveRecord::Migration
2
+ def change
3
+ create_table :books do |t|
4
+ t.string :name
5
+ t.text :desc
6
+ t.date :publish_at
7
+
8
+ t.timestamps null: false
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,27 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20150205063647) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "books", force: :cascade do |t|
20
+ t.string "name"
21
+ t.text "desc"
22
+ t.date "publish_at"
23
+ t.datetime "created_at", null: false
24
+ t.datetime "updated_at", null: false
25
+ end
26
+
27
+ end
@@ -0,0 +1,122 @@
1
+
2
+
3
+ Started GET "/" for ::1 at 2015-02-05 14:36:13 +0800
4
+ Processing by Rails::WelcomeController#index as HTML
5
+ Rendered /Users/tonytonyjan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/templates/rails/welcome/index.html.erb (9.0ms)
6
+ Completed 200 OK in 41ms (Views: 40.9ms | ActiveRecord: 0.0ms)
7
+  (41.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
8
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
9
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
10
+ Migrating to CreateBooks (20150205063647)
11
+  (0.1ms) BEGIN
12
+  (30.7ms) CREATE TABLE "books" ("id" serial primary key, "name" character varying, "desc" text, "publish_at" date, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
13
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20150205063647"]]
14
+  (5.9ms) COMMIT
15
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
16
+  (2.3ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
17
+ FROM pg_constraint c
18
+ JOIN pg_class t1 ON c.conrelid = t1.oid
19
+ JOIN pg_class t2 ON c.confrelid = t2.oid
20
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
21
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
22
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
23
+ WHERE c.contype = 'f'
24
+ AND t1.relname = 'books'
25
+ AND t3.nspname = ANY (current_schemas(false))
26
+ ORDER BY c.conname
27
+ 
28
+
29
+
30
+ Started GET "/admin/books" for ::1 at 2015-02-05 14:37:07 +0800
31
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
32
+ Processing by Admin::BooksController#index as HTML
33
+ Admin::Book Load (0.4ms) SELECT "books".* FROM "books"
34
+ Rendered admin/books/index.html.erb within layouts/admin (9.5ms)
35
+ Completed 500 Internal Server Error in 48ms
36
+
37
+ ActionView::Template::Error (couldn't find file 'jquery'
38
+ (in /Users/tonytonyjan/Dropbox/codes/admin_scaffold/test/dummy/app/assets/javascripts/admin.js:1)):
39
+ 3: <head>
40
+ 4: <title>Dummy</title>
41
+ 5: <%= stylesheet_link_tag 'admin', media: 'all', 'data-turbolinks-track' => true %>
42
+ 6: <%= javascript_include_tag 'admin', 'data-turbolinks-track' => true %>
43
+ 7: <%= csrf_meta_tags %>
44
+ 8: </head>
45
+ 9: <body>
46
+ app/views/layouts/admin.html.erb:6:in `_app_views_layouts_admin_html_erb__2541683043626602486_70258927765140'
47
+
48
+
49
+ Rendered /Users/tonytonyjan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/templates/rescues/_source.erb (8.7ms)
50
+ Rendered /Users/tonytonyjan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (3.2ms)
51
+ Rendered /Users/tonytonyjan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.0ms)
52
+ Rendered /Users/tonytonyjan/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (57.2ms)
53
+
54
+
55
+ Started GET "/admin/books" for ::1 at 2015-02-05 14:41:36 +0800
56
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
57
+ Processing by Admin::BooksController#index as HTML
58
+ Admin::Book Load (0.3ms) SELECT "books".* FROM "books"
59
+ Rendered admin/books/index.html.erb within layouts/admin (2.7ms)
60
+ Completed 200 OK in 1096ms (Views: 1082.2ms | ActiveRecord: 1.6ms)
61
+
62
+
63
+ Started GET "/assets/admin/books-dfa7b291102a59957590b4e00e20f1c8.css?body=1" for ::1 at 2015-02-05 14:41:38 +0800
64
+
65
+
66
+ Started GET "/assets/admin-f118f54045b141205aff0f0dd20f7edf.css?body=1" for ::1 at 2015-02-05 14:41:38 +0800
67
+
68
+
69
+ Started GET "/assets/admin/books-46c9a194bd0668e67d57241f94473dc8.js?body=1" for ::1 at 2015-02-05 14:41:38 +0800
70
+
71
+
72
+ Started GET "/assets/admin-12cb632ca84996e1600655a3ad1827a0.js?body=1" for ::1 at 2015-02-05 14:41:38 +0800
73
+
74
+
75
+ Started GET "/assets/jquery-87424c3c19e96d4fb033c10ebe21ec40.js?body=1" for ::1 at 2015-02-05 14:41:38 +0800
76
+
77
+
78
+ Started GET "/assets/jquery_ujs-e27bd20a10d28155845a22d71ef94f2f.js?body=1" for ::1 at 2015-02-05 14:41:38 +0800
79
+
80
+
81
+ Started GET "/assets/turbolinks-da8ddad9c2c5483d4c5c30c1ce325253.js?body=1" for ::1 at 2015-02-05 14:41:38 +0800
82
+
83
+
84
+ Started GET "/admin/books/new" for ::1 at 2015-02-05 14:41:42 +0800
85
+ Processing by Admin::BooksController#new as HTML
86
+ Rendered admin/books/_form.html.erb (35.3ms)
87
+ Rendered admin/books/new.html.erb within layouts/admin (41.1ms)
88
+ Completed 200 OK in 72ms (Views: 62.2ms | ActiveRecord: 2.3ms)
89
+
90
+
91
+ Started POST "/admin/books" for ::1 at 2015-02-05 14:41:50 +0800
92
+ Processing by Admin::BooksController#create as HTML
93
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"2GV0N7AnuggMouKctcvsAggi2KMkXy21FKmdiFvXQjhyJYP4Dn9VOmRpJL4DQmMOnXE8y/PZnbjCCfFqbgZcng==", "admin_book"=>{"name"=>"Hello", "desc"=>"asdfasdf", "publish_at(1i)"=>"2015", "publish_at(2i)"=>"2", "publish_at(3i)"=>"5"}, "commit"=>"Create Book"}
94
+  (0.2ms) BEGIN
95
+ SQL (0.8ms) INSERT INTO "books" ("name", "desc", "publish_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "Hello"], ["desc", "asdfasdf"], ["publish_at", "2015-02-05"], ["created_at", "2015-02-05 06:41:50.874613"], ["updated_at", "2015-02-05 06:41:50.874613"]]
96
+  (6.2ms) COMMIT
97
+ Redirected to http://localhost:3000/admin/books/1
98
+ Completed 302 Found in 15ms (ActiveRecord: 7.2ms)
99
+
100
+
101
+ Started GET "/admin/books/1" for ::1 at 2015-02-05 14:41:50 +0800
102
+ Processing by Admin::BooksController#show as HTML
103
+ Parameters: {"id"=>"1"}
104
+ Admin::Book Load (0.3ms) SELECT "books".* FROM "books" WHERE "books"."id" = $1 LIMIT 1 [["id", 1]]
105
+ Rendered admin/books/show.html.erb within layouts/admin (1.9ms)
106
+ Completed 200 OK in 36ms (Views: 25.7ms | ActiveRecord: 0.3ms)
107
+
108
+
109
+ Started GET "/assets/jquery-87424c3c19e96d4fb033c10ebe21ec40.js?body=1" for ::1 at 2015-02-05 14:41:51 +0800
110
+
111
+
112
+ Started GET "/assets/jquery_ujs-e27bd20a10d28155845a22d71ef94f2f.js?body=1" for ::1 at 2015-02-05 14:41:51 +0800
113
+
114
+
115
+ Started GET "/assets/turbolinks-da8ddad9c2c5483d4c5c30c1ce325253.js?body=1" for ::1 at 2015-02-05 14:41:51 +0800
116
+
117
+
118
+ Started GET "/admin/books" for ::1 at 2015-02-05 14:41:52 +0800
119
+ Processing by Admin::BooksController#index as HTML
120
+ Admin::Book Load (0.3ms) SELECT "books".* FROM "books"
121
+ Rendered admin/books/index.html.erb within layouts/admin (1.8ms)
122
+ Completed 200 OK in 22ms (Views: 20.8ms | ActiveRecord: 0.3ms)