')
11 |
12 | console.log('Webpack JQuery version: ' + $.fn.jquery)
13 | console.log('Webpack vue version: ' + Vue.version)
14 |
15 | /* eslint-disable no-new */
16 | new Vue({
17 | el: 'div#main_content',
18 | components: {
19 | App
20 | }
21 | })
22 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/ajax_forms/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any styles
10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11 | * file per style scope.
12 | *
13 | *= require_tree .
14 | *= require_self
15 | */
16 |
--------------------------------------------------------------------------------
/app/controllers/ajax_forms/application_controller.rb:
--------------------------------------------------------------------------------
1 | module AjaxForms
2 | class ApplicationController < ActionController::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/helpers/ajax_forms/application_helper.rb:
--------------------------------------------------------------------------------
1 | module AjaxForms
2 | module ApplicationHelper
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/_error_messages.html.erb:
--------------------------------------------------------------------------------
1 | <% if object.errors.any? %>
2 |
3 |
×
4 |
5 | <% object.errors.full_messages.each do |message| %>
6 | - <%= message %>
7 | <% end %>
8 |
9 |
10 | <% end %>
--------------------------------------------------------------------------------
/app/views/layouts/_application.html.erb:
--------------------------------------------------------------------------------
1 |
6 |
7 | <%= yield %>
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/views/quick_response.js.erb:
--------------------------------------------------------------------------------
1 | <% if @model.errors.any? %>
2 | var html = "<%= escape_javascript(render partial:'/error_messages', object: @model, as:'object') %>";
3 | $('#quick-add-errors').html(html);
4 | <% else %>
5 | setSelectResult(<%= @selector %>, <%= @model.id%>, "<%= @model.name %>")
6 | $('<%="div##{@id}"%>').closest("div.fancybox-skin").find("a.fancybox-close").click();
7 | <% end %>
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 |
3 | # TODO: permitir levantar todos los nombres de espacios, no solamente admin:
4 | #ActiveAdmin.application.namespaces.keys.resources
5 | resource_collection = ActiveAdmin.application.namespaces[:admin].resources
6 | resources = resource_collection.select { |resource| resource.respond_to? :resource_class }
7 | pages = resource_collection.select { |resource| resource.is_a? ActiveAdmin::Page }
8 |
9 | resources.each do |resource|
10 | #TODO: Corregir la generación de la ruta para el quick_new
11 | if resource.dsl.ajax_form_enabled
12 | singular = resource.dsl.config.resource_name.singular
13 | plural = resource.dsl.config.resource_name.plural
14 | resource_name = resource.resource_class.to_s.downcase
15 | collection_path = resource.route_collection_path.slice(1..-1)
16 | prefix = resource.route_prefix
17 |
18 | route = "/#{collection_path}"
19 | collection_path_helper = "#{collection_path.gsub('/', '_')}"
20 | member_path_helper = "#{prefix}/#{resource_name}"
21 | get "#{route}/quick_new(/:name/:selectorid)" => "#{collection_path}#quick_new", as: "quick_new_#{member_path_helper}"
22 | end
23 | end
24 |
25 | end
26 |
--------------------------------------------------------------------------------
/config/webpack.config.js:
--------------------------------------------------------------------------------
1 | // Example webpack configuration with asset fingerprinting in production.
2 | 'use strict'
3 |
4 | var path = require('path')
5 | var webpack = require('webpack')
6 | var StatsPlugin = require('stats-webpack-plugin')
7 | var projectRoot = path.resolve(__dirname, '../')
8 | var NpmInstallPlugin = require('npm-install-webpack-plugin')
9 |
10 | // must match config.webpack.dev_server.port
11 | var devServerPort = 3808
12 |
13 | // set NODE_ENV=production on the environment to add asset fingerprints
14 | var production = process.env.NODE_ENV === 'production'
15 |
16 | var config = {
17 | entry: {
18 | // Sources are expected to live in $app_root/webpack
19 | 'application': './webpack/application.js'
20 | },
21 |
22 | output: {
23 | // Build assets directly in to public/webpack/, let webpack know
24 | // that all webpacked assets start with webpack/
25 |
26 | // must match config.webpack.output_dir
27 | path: path.join(__dirname, '..', 'public', 'webpack'),
28 | publicPath: '/webpack/',
29 |
30 | filename: production ? '[name]-[chunkhash].js' : '[name].js'
31 | },
32 |
33 | resolve: {
34 | root: path.join(__dirname, '..', 'webpack')
35 | },
36 |
37 | resolveLoader: {
38 | fallback: [path.join(__dirname, '../node_modules')]
39 | },
40 | module: {
41 | preLoaders: [
42 | ],
43 | loaders: [
44 | {
45 | test: /\.js$/,
46 | loader: 'babel',
47 | include: projectRoot,
48 | exclude: /(node_modules)/
49 | },
50 | {
51 | test: /\.json$/,
52 | loader: 'json'
53 | },
54 | // **IMPORTANT** This is needed so that each bootstrap js file required by
55 | // bootstrap-webpack has access to the jQuery object
56 | { test: /bootstrap\/js\//, loader: 'imports?jQuery=jquery' },
57 | { test: /\.coffee$/, loader: 'coffee-loader' },
58 | { test: /\.(coffee\.md|litcoffee)$/, loader: 'coffee-loader?literate' }
59 | ]
60 | },
61 |
62 | eslint: {
63 | formatter: require('eslint-friendly-formatter')
64 | },
65 |
66 | plugins: [
67 | // must match config.webpack.manifest_filename
68 | new StatsPlugin('manifest.json', {
69 | // We only need assetsByChunkName
70 | chunkModules: false,
71 | source: false,
72 | chunks: false,
73 | modules: false,
74 | assets: true
75 | }),
76 | new NpmInstallPlugin()
77 | ]
78 | }
79 |
80 | if (production) {
81 | config.plugins.push(
82 | new webpack.NoErrorsPlugin(),
83 | new webpack.optimize.UglifyJsPlugin({
84 | compressor: { warnings: false },
85 | sourceMap: false
86 | }),
87 | new webpack.DefinePlugin({
88 | 'process.env': { NODE_ENV: JSON.stringify('production') }
89 | }),
90 | new webpack.optimize.DedupePlugin(),
91 | new webpack.optimize.OccurenceOrderPlugin()
92 | )
93 | } else {
94 | config.devServer = {
95 | port: devServerPort,
96 | headers: { 'Access-Control-Allow-Origin': '*' }
97 | }
98 | config.output.publicPath = '//localhost:' + devServerPort + '/webpack/'
99 | // Source maps
100 | config.devtool = 'cheap-module-eval-source-map'
101 | }
102 |
103 | module.exports = config
104 |
--------------------------------------------------------------------------------
/lib/ajax_forms.rb:
--------------------------------------------------------------------------------
1 | require "ajax_forms/version"
2 | require "ajax_forms/engine"
3 | require "ajax_forms/dsl"
4 |
5 | # ensure that ActiveAdmin is loaded
6 | require "active_admin"
7 |
8 | module ActiveAdminAjaxForms
9 | end
10 |
11 | # Permite que los helpers estén accesibles desde los Resources de Active Admin
12 | ActiveAdmin::ResourceDSL.send :include, ActiveAdminAjaxForms::DSL
--------------------------------------------------------------------------------
/lib/ajax_forms/dsl.rb:
--------------------------------------------------------------------------------
1 | module ActiveAdminAjaxForms
2 | module DSL
3 | attr_accessor :ajax_form_enabled
4 |
5 | #todo: falta completar el pasaje de opciones de configuracion para especificar los partials a renderizar
6 | def ajax_forms options={}
7 | default_options = {
8 | quick_new_partial: nil,
9 | quick_create_partial: nil,
10 | model: config.resource_class,
11 | search_fields: ['name'],
12 | display_column: 'name',
13 | search_condition: 'cont_all'
14 | }
15 | options = default_options.deep_merge(options)
16 |
17 | @ajax_form_enabled = true
18 |
19 | # XXX: usar reflect on association para definir los collection_actions en los modelos
20 | # relacionados donde se quieren buscar los datos
21 | # Por ejemplo, si product belongs_to invoice_line, y quiero crear dinámicamente un producto
22 | # solo hace falta definir en invoice_line que se quiere usar ajax_forms. Automáticamente
23 | # se crean los collection_actions en products para realizar las búsquedas.
24 |
25 | #todo: Posibilidad de especificar los atributos a devolver en el método find. Si no se especifica nada devolver todas las columnas
26 | collection_action :find, :method => :get do
27 | model = resource_class
28 | search_term = params[:q]
29 | groupping_condition = params[:q][:g] rescue nil
30 | ransack_search = options[:search_fields].join('_or_').concat('_').concat(options[:search_condition]).to_sym
31 |
32 | if params[:q_id].present?
33 | params[:q]={:id_equals => params[:q_id]} #selected element
34 | elsif groupping_condition.nil?
35 | params[:q]={
36 | :g=>{
37 | "0"=>{ransack_search=>search_term.split(" ")}
38 | }
39 | }
40 |
41 | # if this search depends on the result of another select box
42 | # we need to add the filter to the existing ransack options
43 | if params[:dependentSelect] and !params[:dependentSelect][:selectorValue].empty?
44 | params[:q][:g]["1"]={params[:dependentSelect][:ransackFilter].to_sym=>params[:dependentSelect][:selectorValue]}
45 | end
46 | end
47 |
48 | q = model.search(params[:q])
49 | @items = q.result.order('id asc', 'name asc').limit(100).map { |item| {:id => item.id, :text => item.to_s} }
50 | respond_to do |format|
51 | format.json { render :json => @items }
52 | end
53 | end
54 |
55 | collection_action :quick_new, :method => :get do
56 | @model = resource_class.new(:name => Base64.decode64(params[:name]))
57 | options[:selector]=params[:selectorid]
58 | #crea una variable de instancia con el nombre del recurso para compatibilidad con partials normales
59 | instance_variable_set("@#{resource_instance_name.to_s}", @model)
60 | @remote = true
61 | @form_url = eval "quick_create_admin_#{resource_collection_name.to_s}_path"
62 |
63 | @id="#{Time.now.to_i.to_s}_#{resource_instance_name.to_s}"
64 | options[:id]=@id
65 |
66 | #todo: tiene que renderizar un formulario por defecto
67 | if options.fetch(:quick_new_partial).nil?
68 | render :nothing => true
69 | else
70 | render partial: options.fetch(:quick_new_partial), layout: 'application'
71 | end
72 | end
73 |
74 | collection_action :quick_create, :method => :post do
75 | @model = resource_class.new(params[resource_instance_name])
76 | @selector=options[:selector]
77 | @model.save
78 | @id=options[:id]
79 | render file: 'quick_response', layout: false
80 | end
81 | end
82 | end
83 | end
84 |
--------------------------------------------------------------------------------
/lib/ajax_forms/engine.rb:
--------------------------------------------------------------------------------
1 | module ActiveAdminAjaxForms
2 | class Engine < ::Rails::Engine
3 | isolate_namespace ActiveAdminAjaxForms
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/lib/ajax_forms/version.rb:
--------------------------------------------------------------------------------
1 | module AjaxForms
2 | VERSION = "0.0.23"
3 | end
4 |
--------------------------------------------------------------------------------
/lib/tasks/ajax_forms_tasks.rake:
--------------------------------------------------------------------------------
1 | # desc "Explaining what the task does"
2 | # task :ajax_forms do
3 | # # Task goes here
4 | # end
5 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "webpack-rails-example",
3 | "version": "0.0.1",
4 | "license": "MIT",
5 | "scripts": {
6 | "dev": "node webpack/build/dev-server.js",
7 | "build": "node webpack/build/build.js",
8 | "lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs"
9 | },
10 | "dependencies": {
11 | "babel-runtime": "^6.0.0",
12 | "bootstrap": "^3.3.7",
13 | "font-awesome": "^4.6.3",
14 | "jquery": "^3.1.0",
15 | "jquery-ui": "^1.12.0",
16 | "lodash": "^4.15.0",
17 | "numeral": "^1.5.3",
18 | "stats-webpack-plugin": "^0.2.1",
19 | "vue": "^2.0.0-rc.3",
20 | "vue-strap": "^1.0.11",
21 | "vuex": "^2.0.0-rc.5"
22 | },
23 | "devDependencies": {
24 | "babel-core": "^6.13.2",
25 | "babel-eslint": "^6.1.2",
26 | "babel-loader": "^6.2.4",
27 | "babel-plugin-transform-runtime": "^6.12.0",
28 | "babel-preset-es2015": "^6.13.2",
29 | "babel-preset-stage-2": "^6.13.0",
30 | "babel-register": "^6.11.6",
31 | "bootstrap-webpack": "0.0.5",
32 | "chai": "^3.5.0",
33 | "chromedriver": "^2.21.2",
34 | "coffee-loader": "^0.7.2",
35 | "coffee-script": "^1.10.0",
36 | "connect-history-api-fallback": "^1.1.0",
37 | "cross-spawn": "^2.1.5",
38 | "css-loader": "^0.23.1",
39 | "eslint": "^2.10.2",
40 | "eslint-config-standard": "^5.1.0",
41 | "eslint-friendly-formatter": "^2.0.5",
42 | "eslint-loader": "^1.3.0",
43 | "eslint-plugin-html": "^1.3.0",
44 | "eslint-plugin-promise": "^1.0.8",
45 | "eslint-plugin-standard": "^1.3.2",
46 | "eventsource-polyfill": "^0.9.6",
47 | "exports-loader": "^0.6.3",
48 | "express": "^4.13.3",
49 | "extract-text-webpack-plugin": "^1.0.1",
50 | "file-loader": "^0.8.4",
51 | "font-awesome-webpack": "0.0.4",
52 | "function-bind": "^1.0.2",
53 | "html-webpack-plugin": "^2.8.1",
54 | "http-proxy-middleware": "^0.12.0",
55 | "imports-loader": "^0.6.5",
56 | "inject-loader": "^2.0.1",
57 | "isparta-loader": "^2.0.0",
58 | "json-loader": "^0.5.4",
59 | "karma": "^0.13.15",
60 | "karma-coverage": "^0.5.5",
61 | "karma-mocha": "^0.2.2",
62 | "karma-phantomjs-launcher": "^1.0.0",
63 | "karma-sinon-chai": "^1.2.0",
64 | "karma-sourcemap-loader": "^0.3.7",
65 | "karma-spec-reporter": "0.0.24",
66 | "karma-webpack": "^1.7.0",
67 | "less": "^2.7.1",
68 | "less-loader": "^2.2.3",
69 | "lolex": "^1.4.0",
70 | "mocha": "^2.4.5",
71 | "nightwatch": "^0.8.18",
72 | "node-sass": "^3.8.0",
73 | "npm-install-webpack-plugin": "^4.0.4",
74 | "ora": "^0.2.0",
75 | "phantomjs-prebuilt": "^2.1.3",
76 | "resolve-url-loader": "^1.6.0",
77 | "sass-loader": "^4.0.0",
78 | "selenium-server": "2.53.0",
79 | "shelljs": "^0.6.0",
80 | "sinon": "^1.17.3",
81 | "sinon-chai": "^2.8.0",
82 | "style-loader": "^0.13.1",
83 | "url-loader": "^0.5.7",
84 | "vue-hot-reload-api": "^2.0.6",
85 | "vue-html-loader": "^1.2.3",
86 | "vue-loader": "^9.4.0",
87 | "vue-style-loader": "^1.0.0",
88 | "webpack": "^1.12.2",
89 | "webpack-dev-server": "^1.9.0",
90 | "webpack-dev-middleware": "^1.6.1",
91 | "webpack-hot-middleware": "^2.12.2",
92 | "webpack-merge": "^0.8.3"
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/test/ajax_forms_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class AjaxFormsTest < ActiveSupport::TestCase
4 | test "truth" do
5 | assert_kind_of Module, AjaxForms
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/test/dummy/Procfile:
--------------------------------------------------------------------------------
1 | # Run Rails & Webpack concurrently
2 | # Example file from webpack-rails gem
3 | rails: bundle exec rails server
4 | webpack: cd ../../ && npm run dev
5 |
--------------------------------------------------------------------------------
/test/dummy/README.rdoc:
--------------------------------------------------------------------------------
1 | == README
2 |
3 | This README would normally document whatever steps are necessary to get the
4 | application up and running.
5 |
6 | Things you may want to cover:
7 |
8 | * Ruby version
9 |
10 | * System dependencies
11 |
12 | * Configuration
13 |
14 | * Database creation
15 |
16 | * Database initialization
17 |
18 | * How to run the test suite
19 |
20 | * Services (job queues, cache servers, search engines, etc.)
21 |
22 | * Deployment instructions
23 |
24 | * ...
25 |
26 |
27 | Please feel free to use a different markup language if you do not plan to run
28 | rake doc:app.
29 |
--------------------------------------------------------------------------------
/test/dummy/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require File.expand_path('../config/application', __FILE__)
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/test/dummy/app/admin/admin_user.rb:
--------------------------------------------------------------------------------
1 | ActiveAdmin.register AdminUser do
2 | permit_params :email, :password, :password_confirmation
3 |
4 | index do
5 | selectable_column
6 | id_column
7 | column :email
8 | column :current_sign_in_at
9 | column :sign_in_count
10 | column :created_at
11 | actions
12 | end
13 |
14 | filter :email
15 | filter :current_sign_in_at
16 | filter :sign_in_count
17 | filter :created_at
18 |
19 | form do |f|
20 | f.inputs "Admin Details" do
21 | f.input :email
22 | f.input :password
23 | f.input :password_confirmation
24 | end
25 | f.actions
26 | end
27 |
28 | end
29 |
--------------------------------------------------------------------------------
/test/dummy/app/admin/dashboard.rb:
--------------------------------------------------------------------------------
1 | ActiveAdmin.register_page "Dashboard" do
2 |
3 | menu priority: 1, label: proc{ I18n.t("active_admin.dashboard") }
4 |
5 | content title: proc{ I18n.t("active_admin.dashboard") } do
6 | div class: "blank_slate_container", id: "dashboard_default_message" do
7 | span class: "blank_slate" do
8 | span I18n.t("active_admin.dashboard_welcome.welcome")
9 | small I18n.t("active_admin.dashboard_welcome.call_to_action")
10 | end
11 | end
12 |
13 | # Here is an example of a simple dashboard with columns and panels.
14 | #
15 | # columns do
16 | # column do
17 | # panel "Recent Posts" do
18 | # ul do
19 | # Post.recent(5).map do |post|
20 | # li link_to(post.title, admin_post_path(post))
21 | # end
22 | # end
23 | # end
24 | # end
25 |
26 | # column do
27 | # panel "Info" do
28 | # para "Welcome to ActiveAdmin."
29 | # end
30 | # end
31 | # end
32 | end # content
33 | end
34 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/test/dummy/app/assets/images/.keep
--------------------------------------------------------------------------------
/test/dummy/app/assets/javascripts/active_admin.js.coffee:
--------------------------------------------------------------------------------
1 | #= require active_admin/base
2 |
3 | console.log('Global JQuery version: ' + $.fn.jquery)
4 |
5 | $ ->
6 | hostname = window.location.hostname.toString()
7 | script = ''
8 | $('body').append($(script))
9 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/javascripts/application.js:
--------------------------------------------------------------------------------
1 | // This is a manifest file that'll be compiled into application.js, which will include all the files
2 | // listed below.
3 | //
4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6 | //
7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 | // compiled file.
9 | //
10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11 | // about supported directives.
12 | //
13 | //= require_tree .
14 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/stylesheets/active_admin.scss:
--------------------------------------------------------------------------------
1 | // SASS variable overrides must be declared before loading up Active Admin's styles.
2 | //
3 | // To view the variables that Active Admin provides, take a look at
4 | // `app/assets/stylesheets/active_admin/mixins/_variables.scss` in the
5 | // Active Admin source.
6 | //
7 | // For example, to change the sidebar width:
8 | // $sidebar-width: 242px;
9 |
10 | // Active Admin's got SASS!
11 | @import "active_admin/mixins";
12 | @import "active_admin/base";
13 | @import "select2";
14 |
15 | // Overriding any non-variable SASS must be done after the fact.
16 | // For example, to change the default status-tag color:
17 | //
18 | // .status_tag { background: #6090DB; }
19 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any styles
10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11 | * file per style scope.
12 | *
13 | *= require_tree .
14 | *= require_self
15 | */
16 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/stylesheets/select2.css:
--------------------------------------------------------------------------------
1 | .select2-container {
2 | box-sizing: border-box;
3 | display: inline-block;
4 | margin: 0;
5 | position: relative;
6 | vertical-align: middle; }
7 | .select2-container .select2-selection--single {
8 | box-sizing: border-box;
9 | cursor: pointer;
10 | display: block;
11 | height: 28px;
12 | user-select: none;
13 | -webkit-user-select: none; }
14 | .select2-container .select2-selection--single .select2-selection__rendered {
15 | display: block;
16 | padding-left: 8px;
17 | padding-right: 20px;
18 | overflow: hidden;
19 | text-overflow: ellipsis;
20 | white-space: nowrap; }
21 | .select2-container .select2-selection--single .select2-selection__clear {
22 | position: relative; }
23 | .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
24 | padding-right: 8px;
25 | padding-left: 20px; }
26 | .select2-container .select2-selection--multiple {
27 | box-sizing: border-box;
28 | cursor: pointer;
29 | display: block;
30 | min-height: 32px;
31 | user-select: none;
32 | -webkit-user-select: none; }
33 | .select2-container .select2-selection--multiple .select2-selection__rendered {
34 | display: inline-block;
35 | overflow: hidden;
36 | padding-left: 8px;
37 | text-overflow: ellipsis;
38 | white-space: nowrap; }
39 | .select2-container .select2-search--inline {
40 | float: left; }
41 | .select2-container .select2-search--inline .select2-search__field {
42 | box-sizing: border-box;
43 | border: none;
44 | font-size: 100%;
45 | margin-top: 5px;
46 | padding: 0; }
47 | .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
48 | -webkit-appearance: none; }
49 |
50 | .select2-dropdown {
51 | background-color: white;
52 | border: 1px solid #aaa;
53 | border-radius: 4px;
54 | box-sizing: border-box;
55 | display: block;
56 | position: absolute;
57 | left: -100000px;
58 | width: 100%;
59 | z-index: 1051; }
60 |
61 | .select2-results {
62 | display: block; }
63 |
64 | .select2-results__options {
65 | list-style: none;
66 | margin: 0;
67 | padding: 0; }
68 |
69 | .select2-results__option {
70 | padding: 6px;
71 | user-select: none;
72 | -webkit-user-select: none; }
73 | .select2-results__option[aria-selected] {
74 | cursor: pointer; }
75 |
76 | .select2-container--open .select2-dropdown {
77 | left: 0; }
78 |
79 | .select2-container--open .select2-dropdown--above {
80 | border-bottom: none;
81 | border-bottom-left-radius: 0;
82 | border-bottom-right-radius: 0; }
83 |
84 | .select2-container--open .select2-dropdown--below {
85 | border-top: none;
86 | border-top-left-radius: 0;
87 | border-top-right-radius: 0; }
88 |
89 | .select2-search--dropdown {
90 | display: block;
91 | padding: 4px; }
92 | .select2-search--dropdown .select2-search__field {
93 | padding: 4px;
94 | width: 100%;
95 | box-sizing: border-box; }
96 | .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
97 | -webkit-appearance: none; }
98 | .select2-search--dropdown.select2-search--hide {
99 | display: none; }
100 |
101 | .select2-close-mask {
102 | border: 0;
103 | margin: 0;
104 | padding: 0;
105 | display: block;
106 | position: fixed;
107 | left: 0;
108 | top: 0;
109 | min-height: 100%;
110 | min-width: 100%;
111 | height: auto;
112 | width: auto;
113 | opacity: 0;
114 | z-index: 99;
115 | background-color: #fff;
116 | filter: alpha(opacity=0); }
117 |
118 | .select2-hidden-accessible {
119 | border: 0 !important;
120 | clip: rect(0 0 0 0) !important;
121 | height: 1px !important;
122 | margin: -1px !important;
123 | overflow: hidden !important;
124 | padding: 0 !important;
125 | position: absolute !important;
126 | width: 1px !important; }
127 |
128 | .select2-container--default .select2-selection--single {
129 | background-color: #fff;
130 | border: 1px solid #aaa;
131 | border-radius: 4px; }
132 | .select2-container--default .select2-selection--single .select2-selection__rendered {
133 | color: #444;
134 | line-height: 28px; }
135 | .select2-container--default .select2-selection--single .select2-selection__clear {
136 | cursor: pointer;
137 | float: right;
138 | font-weight: bold; }
139 | .select2-container--default .select2-selection--single .select2-selection__placeholder {
140 | color: #999; }
141 | .select2-container--default .select2-selection--single .select2-selection__arrow {
142 | height: 26px;
143 | position: absolute;
144 | top: 1px;
145 | right: 1px;
146 | width: 20px; }
147 | .select2-container--default .select2-selection--single .select2-selection__arrow b {
148 | border-color: #888 transparent transparent transparent;
149 | border-style: solid;
150 | border-width: 5px 4px 0 4px;
151 | height: 0;
152 | left: 50%;
153 | margin-left: -4px;
154 | margin-top: -2px;
155 | position: absolute;
156 | top: 50%;
157 | width: 0; }
158 |
159 | .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
160 | float: left; }
161 |
162 | .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
163 | left: 1px;
164 | right: auto; }
165 |
166 | .select2-container--default.select2-container--disabled .select2-selection--single {
167 | background-color: #eee;
168 | cursor: default; }
169 | .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
170 | display: none; }
171 |
172 | .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
173 | border-color: transparent transparent #888 transparent;
174 | border-width: 0 4px 5px 4px; }
175 |
176 | .select2-container--default .select2-selection--multiple {
177 | background-color: white;
178 | border: 1px solid #aaa;
179 | border-radius: 4px;
180 | cursor: text; }
181 | .select2-container--default .select2-selection--multiple .select2-selection__rendered {
182 | box-sizing: border-box;
183 | list-style: none;
184 | margin: 0;
185 | padding: 0 5px;
186 | width: 100%; }
187 | .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
188 | list-style: none; }
189 | .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
190 | color: #999;
191 | margin-top: 5px;
192 | float: left; }
193 | .select2-container--default .select2-selection--multiple .select2-selection__clear {
194 | cursor: pointer;
195 | float: right;
196 | font-weight: bold;
197 | margin-top: 5px;
198 | margin-right: 10px; }
199 | .select2-container--default .select2-selection--multiple .select2-selection__choice {
200 | background-color: #e4e4e4;
201 | border: 1px solid #aaa;
202 | border-radius: 4px;
203 | cursor: default;
204 | float: left;
205 | margin-right: 5px;
206 | margin-top: 5px;
207 | padding: 0 5px; }
208 | .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
209 | color: #999;
210 | cursor: pointer;
211 | display: inline-block;
212 | font-weight: bold;
213 | margin-right: 2px; }
214 | .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
215 | color: #333; }
216 |
217 | .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
218 | float: right; }
219 |
220 | .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
221 | margin-left: 5px;
222 | margin-right: auto; }
223 |
224 | .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
225 | margin-left: 2px;
226 | margin-right: auto; }
227 |
228 | .select2-container--default.select2-container--focus .select2-selection--multiple {
229 | border: solid black 1px;
230 | outline: 0; }
231 |
232 | .select2-container--default.select2-container--disabled .select2-selection--multiple {
233 | background-color: #eee;
234 | cursor: default; }
235 |
236 | .select2-container--default.select2-container--disabled .select2-selection__choice__remove {
237 | display: none; }
238 |
239 | .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
240 | border-top-left-radius: 0;
241 | border-top-right-radius: 0; }
242 |
243 | .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
244 | border-bottom-left-radius: 0;
245 | border-bottom-right-radius: 0; }
246 |
247 | .select2-container--default .select2-search--dropdown .select2-search__field {
248 | border: 1px solid #aaa; }
249 |
250 | .select2-container--default .select2-search--inline .select2-search__field {
251 | background: transparent;
252 | border: none;
253 | outline: 0;
254 | box-shadow: none;
255 | -webkit-appearance: textfield; }
256 |
257 | .select2-container--default .select2-results > .select2-results__options {
258 | max-height: 200px;
259 | overflow-y: auto; }
260 |
261 | .select2-container--default .select2-results__option[role=group] {
262 | padding: 0; }
263 |
264 | .select2-container--default .select2-results__option[aria-disabled=true] {
265 | color: #999; }
266 |
267 | .select2-container--default .select2-results__option[aria-selected=true] {
268 | background-color: #ddd; }
269 |
270 | .select2-container--default .select2-results__option .select2-results__option {
271 | padding-left: 1em; }
272 | .select2-container--default .select2-results__option .select2-results__option .select2-results__group {
273 | padding-left: 0; }
274 | .select2-container--default .select2-results__option .select2-results__option .select2-results__option {
275 | margin-left: -1em;
276 | padding-left: 2em; }
277 | .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
278 | margin-left: -2em;
279 | padding-left: 3em; }
280 | .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
281 | margin-left: -3em;
282 | padding-left: 4em; }
283 | .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
284 | margin-left: -4em;
285 | padding-left: 5em; }
286 | .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
287 | margin-left: -5em;
288 | padding-left: 6em; }
289 |
290 | .select2-container--default .select2-results__option--highlighted[aria-selected] {
291 | background-color: #5897fb;
292 | color: white; }
293 |
294 | .select2-container--default .select2-results__group {
295 | cursor: default;
296 | display: block;
297 | padding: 6px; }
298 |
299 | .select2-container--classic .select2-selection--single {
300 | background-color: #f7f7f7;
301 | border: 1px solid #aaa;
302 | border-radius: 4px;
303 | outline: 0;
304 | background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
305 | background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
306 | background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
307 | background-repeat: repeat-x;
308 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
309 | .select2-container--classic .select2-selection--single:focus {
310 | border: 1px solid #5897fb; }
311 | .select2-container--classic .select2-selection--single .select2-selection__rendered {
312 | color: #444;
313 | line-height: 28px; }
314 | .select2-container--classic .select2-selection--single .select2-selection__clear {
315 | cursor: pointer;
316 | float: right;
317 | font-weight: bold;
318 | margin-right: 10px; }
319 | .select2-container--classic .select2-selection--single .select2-selection__placeholder {
320 | color: #999; }
321 | .select2-container--classic .select2-selection--single .select2-selection__arrow {
322 | background-color: #ddd;
323 | border: none;
324 | border-left: 1px solid #aaa;
325 | border-top-right-radius: 4px;
326 | border-bottom-right-radius: 4px;
327 | height: 26px;
328 | position: absolute;
329 | top: 1px;
330 | right: 1px;
331 | width: 20px;
332 | background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
333 | background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
334 | background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
335 | background-repeat: repeat-x;
336 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
337 | .select2-container--classic .select2-selection--single .select2-selection__arrow b {
338 | border-color: #888 transparent transparent transparent;
339 | border-style: solid;
340 | border-width: 5px 4px 0 4px;
341 | height: 0;
342 | left: 50%;
343 | margin-left: -4px;
344 | margin-top: -2px;
345 | position: absolute;
346 | top: 50%;
347 | width: 0; }
348 |
349 | .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
350 | float: left; }
351 |
352 | .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
353 | border: none;
354 | border-right: 1px solid #aaa;
355 | border-radius: 0;
356 | border-top-left-radius: 4px;
357 | border-bottom-left-radius: 4px;
358 | left: 1px;
359 | right: auto; }
360 |
361 | .select2-container--classic.select2-container--open .select2-selection--single {
362 | border: 1px solid #5897fb; }
363 | .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
364 | background: transparent;
365 | border: none; }
366 | .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
367 | border-color: transparent transparent #888 transparent;
368 | border-width: 0 4px 5px 4px; }
369 |
370 | .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
371 | border-top: none;
372 | border-top-left-radius: 0;
373 | border-top-right-radius: 0;
374 | background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
375 | background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
376 | background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
377 | background-repeat: repeat-x;
378 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
379 |
380 | .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
381 | border-bottom: none;
382 | border-bottom-left-radius: 0;
383 | border-bottom-right-radius: 0;
384 | background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
385 | background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
386 | background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
387 | background-repeat: repeat-x;
388 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
389 |
390 | .select2-container--classic .select2-selection--multiple {
391 | background-color: white;
392 | border: 1px solid #aaa;
393 | border-radius: 4px;
394 | cursor: text;
395 | outline: 0; }
396 | .select2-container--classic .select2-selection--multiple:focus {
397 | border: 1px solid #5897fb; }
398 | .select2-container--classic .select2-selection--multiple .select2-selection__rendered {
399 | list-style: none;
400 | margin: 0;
401 | padding: 0 5px; }
402 | .select2-container--classic .select2-selection--multiple .select2-selection__clear {
403 | display: none; }
404 | .select2-container--classic .select2-selection--multiple .select2-selection__choice {
405 | background-color: #e4e4e4;
406 | border: 1px solid #aaa;
407 | border-radius: 4px;
408 | cursor: default;
409 | float: left;
410 | margin-right: 5px;
411 | margin-top: 5px;
412 | padding: 0 5px; }
413 | .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
414 | color: #888;
415 | cursor: pointer;
416 | display: inline-block;
417 | font-weight: bold;
418 | margin-right: 2px; }
419 | .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
420 | color: #555; }
421 |
422 | .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
423 | float: right; }
424 |
425 | .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
426 | margin-left: 5px;
427 | margin-right: auto; }
428 |
429 | .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
430 | margin-left: 2px;
431 | margin-right: auto; }
432 |
433 | .select2-container--classic.select2-container--open .select2-selection--multiple {
434 | border: 1px solid #5897fb; }
435 |
436 | .select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
437 | border-top: none;
438 | border-top-left-radius: 0;
439 | border-top-right-radius: 0; }
440 |
441 | .select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
442 | border-bottom: none;
443 | border-bottom-left-radius: 0;
444 | border-bottom-right-radius: 0; }
445 |
446 | .select2-container--classic .select2-search--dropdown .select2-search__field {
447 | border: 1px solid #aaa;
448 | outline: 0; }
449 |
450 | .select2-container--classic .select2-search--inline .select2-search__field {
451 | outline: 0;
452 | box-shadow: none; }
453 |
454 | .select2-container--classic .select2-dropdown {
455 | background-color: white;
456 | border: 1px solid transparent; }
457 |
458 | .select2-container--classic .select2-dropdown--above {
459 | border-bottom: none; }
460 |
461 | .select2-container--classic .select2-dropdown--below {
462 | border-top: none; }
463 |
464 | .select2-container--classic .select2-results > .select2-results__options {
465 | max-height: 200px;
466 | overflow-y: auto; }
467 |
468 | .select2-container--classic .select2-results__option[role=group] {
469 | padding: 0; }
470 |
471 | .select2-container--classic .select2-results__option[aria-disabled=true] {
472 | color: grey; }
473 |
474 | .select2-container--classic .select2-results__option--highlighted[aria-selected] {
475 | background-color: #3875d7;
476 | color: white; }
477 |
478 | .select2-container--classic .select2-results__group {
479 | cursor: default;
480 | display: block;
481 | padding: 6px; }
482 |
483 | .select2-container--classic.select2-container--open .select2-dropdown {
484 | border-color: #5897fb; }
485 |
--------------------------------------------------------------------------------
/test/dummy/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | # Prevent CSRF attacks by raising an exception.
3 | # For APIs, you may want to use :null_session instead.
4 | protect_from_forgery with: :exception
5 | end
6 |
--------------------------------------------------------------------------------
/test/dummy/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/test/dummy/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/test/dummy/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/test/dummy/app/mailers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/test/dummy/app/mailers/.keep
--------------------------------------------------------------------------------
/test/dummy/app/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/test/dummy/app/models/.keep
--------------------------------------------------------------------------------
/test/dummy/app/models/admin_user.rb:
--------------------------------------------------------------------------------
1 | class AdminUser < ActiveRecord::Base
2 | # Include default devise modules. Others available are:
3 | # :confirmable, :lockable, :timeoutable and :omniauthable
4 | devise :database_authenticatable,
5 | :recoverable, :rememberable, :trackable, :validatable
6 | end
7 |
--------------------------------------------------------------------------------
/test/dummy/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/test/dummy/app/models/concerns/.keep
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/confirmations/new.html.erb:
--------------------------------------------------------------------------------
1 | Resend confirmation instructions
2 |
3 | <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= devise_error_messages! %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
9 |
10 |
11 |
12 | <%= f.submit "Resend confirmation instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/mailer/confirmation_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Welcome <%= @email %>!
2 |
3 | You can confirm your account email through the link below:
4 |
5 | <%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>
6 |
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/mailer/password_change.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @resource.email %>!
2 |
3 | We're contacting you to notify you that your password has been changed.
4 |
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/mailer/reset_password_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @resource.email %>!
2 |
3 | Someone has requested a link to change your password. You can do this through the link below.
4 |
5 | <%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>
6 |
7 | If you didn't request this, please ignore this email.
8 | Your password won't change until you access the link above and create a new one.
9 |
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/mailer/unlock_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @resource.email %>!
2 |
3 | Your account has been locked due to an excessive number of unsuccessful sign in attempts.
4 |
5 | Click the link below to unlock your account:
6 |
7 | <%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>
8 |
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/passwords/edit.html.erb:
--------------------------------------------------------------------------------
1 | Change your password
2 |
3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4 | <%= devise_error_messages! %>
5 | <%= f.hidden_field :reset_password_token %>
6 |
7 |
8 | <%= f.label :password, "New password" %>
9 | <% if @minimum_password_length %>
10 | (<%= @minimum_password_length %> characters minimum)
11 | <% end %>
12 | <%= f.password_field :password, autofocus: true, autocomplete: "off" %>
13 |
14 |
15 |
16 | <%= f.label :password_confirmation, "Confirm new password" %>
17 | <%= f.password_field :password_confirmation, autocomplete: "off" %>
18 |
19 |
20 |
21 | <%= f.submit "Change my password" %>
22 |
23 | <% end %>
24 |
25 | <%= render "devise/shared/links" %>
26 |
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/passwords/new.html.erb:
--------------------------------------------------------------------------------
1 | Forgot your password?
2 |
3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= devise_error_messages! %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true %>
9 |
10 |
11 |
12 | <%= f.submit "Send me reset password instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/registrations/edit.html.erb:
--------------------------------------------------------------------------------
1 | Edit <%= resource_name.to_s.humanize %>
2 |
3 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
4 | <%= devise_error_messages! %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true %>
9 |
10 |
11 | <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
12 | Currently waiting confirmation for: <%= resource.unconfirmed_email %>
13 | <% end %>
14 |
15 |
16 | <%= f.label :password %> (leave blank if you don't want to change it)
17 | <%= f.password_field :password, autocomplete: "off" %>
18 | <% if @minimum_password_length %>
19 |
20 | <%= @minimum_password_length %> characters minimum
21 | <% end %>
22 |
23 |
24 |
25 | <%= f.label :password_confirmation %>
26 | <%= f.password_field :password_confirmation, autocomplete: "off" %>
27 |
28 |
29 |
30 | <%= f.label :current_password %> (we need your current password to confirm your changes)
31 | <%= f.password_field :current_password, autocomplete: "off" %>
32 |
33 |
34 |
35 | <%= f.submit "Update" %>
36 |
37 | <% end %>
38 |
39 | Cancel my account
40 |
41 | Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>
42 |
43 | <%= link_to "Back", :back %>
44 |
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/registrations/new.html.erb:
--------------------------------------------------------------------------------
1 | Sign up
2 |
3 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
4 | <%= devise_error_messages! %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true %>
9 |
10 |
11 |
12 | <%= f.label :password %>
13 | <% if @minimum_password_length %>
14 | (<%= @minimum_password_length %> characters minimum)
15 | <% end %>
16 | <%= f.password_field :password, autocomplete: "off" %>
17 |
18 |
19 |
20 | <%= f.label :password_confirmation %>
21 | <%= f.password_field :password_confirmation, autocomplete: "off" %>
22 |
23 |
24 |
25 | <%= f.submit "Sign up" %>
26 |
27 | <% end %>
28 |
29 | <%= render "devise/shared/links" %>
30 |
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/sessions/new.html.erb:
--------------------------------------------------------------------------------
1 | Log in
2 |
3 | <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
4 |
5 | <%= f.label :email %>
6 | <%= f.email_field :email, autofocus: true %>
7 |
8 |
9 |
10 | <%= f.label :password %>
11 | <%= f.password_field :password, autocomplete: "off" %>
12 |
13 |
14 | <% if devise_mapping.rememberable? -%>
15 |
16 | <%= f.check_box :remember_me %>
17 | <%= f.label :remember_me %>
18 |
19 | <% end -%>
20 |
21 |
22 | <%= f.submit "Log in" %>
23 |
24 | <% end %>
25 |
26 | <%= render "devise/shared/links" %>
27 |
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/shared/_links.html.erb:
--------------------------------------------------------------------------------
1 | <%- if controller_name != 'sessions' %>
2 | <%= link_to "Log in", new_session_path(resource_name) %>
3 | <% end -%>
4 |
5 | <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6 | <%= link_to "Sign up", new_registration_path(resource_name) %>
7 | <% end -%>
8 |
9 | <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
10 | <%= link_to "Forgot your password?", new_password_path(resource_name) %>
11 | <% end -%>
12 |
13 | <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14 | <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
15 | <% end -%>
16 |
17 | <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18 | <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
19 | <% end -%>
20 |
21 | <%- if devise_mapping.omniauthable? %>
22 | <%- resource_class.omniauth_providers.each do |provider| %>
23 | <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %>
24 | <% end -%>
25 | <% end -%>
26 |
--------------------------------------------------------------------------------
/test/dummy/app/views/devise/unlocks/new.html.erb:
--------------------------------------------------------------------------------
1 | Resend unlock instructions
2 |
3 | <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= devise_error_messages! %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true %>
9 |
10 |
11 |
12 | <%= f.submit "Resend unlock instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/test/dummy/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Dummy
5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | <%= notice %>
12 | <%= alert %>
13 |
14 | <%= yield %>
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/test/dummy/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/test/dummy/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path('../../config/application', __FILE__)
3 | require_relative '../config/boot'
4 | require 'rails/commands'
5 |
--------------------------------------------------------------------------------
/test/dummy/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative '../config/boot'
3 | require 'rake'
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/test/dummy/config.ru:
--------------------------------------------------------------------------------
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
5 |
--------------------------------------------------------------------------------
/test/dummy/config/application.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../boot', __FILE__)
2 |
3 | require 'rails/all'
4 |
5 | Bundler.require(*Rails.groups)
6 | require "ajax_forms"
7 |
8 | module Dummy
9 | class Application < Rails::Application
10 | # Settings in config/environments/* take precedence over those specified here.
11 | # Application configuration should go into files in config/initializers
12 | # -- all .rb files in that directory are automatically loaded.
13 |
14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16 | # config.time_zone = 'Central Time (US & Canada)'
17 |
18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20 | # config.i18n.default_locale = :de
21 | end
22 | end
23 |
24 |
--------------------------------------------------------------------------------
/test/dummy/config/boot.rb:
--------------------------------------------------------------------------------
1 | # Set up gems listed in the Gemfile.
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3 |
4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
6 |
--------------------------------------------------------------------------------
/test/dummy/config/database.yml:
--------------------------------------------------------------------------------
1 | # SQLite version 3.x
2 | # gem install sqlite3
3 | #
4 | # Ensure the SQLite 3 gem is defined in your Gemfile
5 | # gem 'sqlite3'
6 | #
7 | default: &default
8 | adapter: sqlite3
9 | pool: 5
10 | timeout: 5000
11 |
12 | development:
13 | <<: *default
14 | database: db/development.sqlite3
15 |
16 | # Warning: The database defined as "test" will be erased and
17 | # re-generated from your development database when you run "rake".
18 | # Do not set this db to the same as development or production.
19 | test:
20 | <<: *default
21 | database: db/test.sqlite3
22 |
23 | production:
24 | <<: *default
25 | database: db/production.sqlite3
26 |
--------------------------------------------------------------------------------
/test/dummy/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/development.rb:
--------------------------------------------------------------------------------
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 | # Adds additional error checking when serving assets at runtime.
31 | # Checks for improperly declared sprockets dependencies.
32 | # Raises helpful error messages.
33 | config.assets.raise_runtime_errors = true
34 |
35 | # Raises error for missing translations
36 | # config.action_view.raise_on_missing_translations = true
37 |
38 | config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
39 | end
40 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/production.rb:
--------------------------------------------------------------------------------
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 nginx, varnish or squid.
20 | # config.action_dispatch.rack_cache = true
21 |
22 | # Disable Rails's static asset server (Apache or nginx will already do this).
23 | config.serve_static_assets = false
24 |
25 | # Compress JavaScripts and CSS.
26 | config.assets.js_compressor = :uglifier
27 | # config.assets.css_compressor = :sass
28 |
29 | # Do not fallback to assets pipeline if a precompiled asset is missed.
30 | config.assets.compile = false
31 |
32 | # Generate digests for assets URLs.
33 | config.assets.digest = true
34 |
35 | # `config.assets.precompile` has moved to config/initializers/assets.rb
36 |
37 | # Specifies the header that your server uses for sending files.
38 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
39 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
40 |
41 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
42 | # config.force_ssl = true
43 |
44 | # Set to :debug to see everything in the log.
45 | config.log_level = :info
46 |
47 | # Prepend all log lines with the following tags.
48 | # config.log_tags = [ :subdomain, :uuid ]
49 |
50 | # Use a different logger for distributed setups.
51 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
52 |
53 | # Use a different cache store in production.
54 | # config.cache_store = :mem_cache_store
55 |
56 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
57 | # config.action_controller.asset_host = "http://assets.example.com"
58 |
59 | # Precompile additional assets.
60 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
61 | # config.assets.precompile += %w( search.js )
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 | # Disable automatic flushing of the log to improve performance.
75 | # config.autoflush_log = false
76 |
77 | # Use default logging formatter so that PID and timestamp are not suppressed.
78 | config.log_formatter = ::Logger::Formatter.new
79 |
80 | # Do not dump schema after migrations.
81 | config.active_record.dump_schema_after_migration = false
82 | end
83 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/test.rb:
--------------------------------------------------------------------------------
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 asset server for tests with Cache-Control for performance.
16 | config.serve_static_assets = 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 | # Print deprecation notices to the stderr.
35 | config.active_support.deprecation = :stderr
36 |
37 | # Raises error for missing translations
38 | # config.action_view.raise_on_missing_translations = true
39 | end
40 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/active_admin.rb:
--------------------------------------------------------------------------------
1 | ActiveAdmin.setup do |config|
2 | # == Site Title
3 | #
4 | # Set the title that is displayed on the main layout
5 | # for each of the active admin pages.
6 | #
7 | config.site_title = "Dummy"
8 |
9 | # Set the link url for the title. For example, to take
10 | # users to your main site. Defaults to no link.
11 | #
12 | # config.site_title_link = "/"
13 |
14 | # Set an optional image to be displayed for the header
15 | # instead of a string (overrides :site_title)
16 | #
17 | # Note: Aim for an image that's 21px high so it fits in the header.
18 | #
19 | # config.site_title_image = "logo.png"
20 |
21 | # == Default Namespace
22 | #
23 | # Set the default namespace each administration resource
24 | # will be added to.
25 | #
26 | # eg:
27 | # config.default_namespace = :hello_world
28 | #
29 | # This will create resources in the HelloWorld module and
30 | # will namespace routes to /hello_world/*
31 | #
32 | # To set no namespace by default, use:
33 | # config.default_namespace = false
34 | #
35 | # Default:
36 | # config.default_namespace = :admin
37 | #
38 | # You can customize the settings for each namespace by using
39 | # a namespace block. For example, to change the site title
40 | # within a namespace:
41 | #
42 | # config.namespace :admin do |admin|
43 | # admin.site_title = "Custom Admin Title"
44 | # end
45 | #
46 | # This will ONLY change the title for the admin section. Other
47 | # namespaces will continue to use the main "site_title" configuration.
48 |
49 | # == User Authentication
50 | #
51 | # Active Admin will automatically call an authentication
52 | # method in a before filter of all controller actions to
53 | # ensure that there is a currently logged in admin user.
54 | #
55 | # This setting changes the method which Active Admin calls
56 | # within the application controller.
57 | config.authentication_method = :authenticate_admin_user!
58 |
59 | # == User Authorization
60 | #
61 | # Active Admin will automatically call an authorization
62 | # method in a before filter of all controller actions to
63 | # ensure that there is a user with proper rights. You can use
64 | # CanCanAdapter or make your own. Please refer to documentation.
65 | # config.authorization_adapter = ActiveAdmin::CanCanAdapter
66 |
67 | # In case you prefer Pundit over other solutions you can here pass
68 | # the name of default policy class. This policy will be used in every
69 | # case when Pundit is unable to find suitable policy.
70 | # config.pundit_default_policy = "MyDefaultPunditPolicy"
71 |
72 | # You can customize your CanCan Ability class name here.
73 | # config.cancan_ability_class = "Ability"
74 |
75 | # You can specify a method to be called on unauthorized access.
76 | # This is necessary in order to prevent a redirect loop which happens
77 | # because, by default, user gets redirected to Dashboard. If user
78 | # doesn't have access to Dashboard, he'll end up in a redirect loop.
79 | # Method provided here should be defined in application_controller.rb.
80 | # config.on_unauthorized_access = :access_denied
81 |
82 | # == Current User
83 | #
84 | # Active Admin will associate actions with the current
85 | # user performing them.
86 | #
87 | # This setting changes the method which Active Admin calls
88 | # (within the application controller) to return the currently logged in user.
89 | config.current_user_method = :current_admin_user
90 |
91 | # == Logging Out
92 | #
93 | # Active Admin displays a logout link on each screen. These
94 | # settings configure the location and method used for the link.
95 | #
96 | # This setting changes the path where the link points to. If it's
97 | # a string, the strings is used as the path. If it's a Symbol, we
98 | # will call the method to return the path.
99 | #
100 | # Default:
101 | config.logout_link_path = :destroy_admin_user_session_path
102 |
103 | # This setting changes the http method used when rendering the
104 | # link. For example :get, :delete, :put, etc..
105 | #
106 | # Default:
107 | # config.logout_link_method = :get
108 |
109 | # == Root
110 | #
111 | # Set the action to call for the root path. You can set different
112 | # roots for each namespace.
113 | #
114 | # Default:
115 | # config.root_to = 'dashboard#index'
116 |
117 | # == Admin Comments
118 | #
119 | # This allows your users to comment on any resource registered with Active Admin.
120 | #
121 | # You can completely disable comments:
122 | # config.comments = false
123 | #
124 | # You can change the name under which comments are registered:
125 | # config.comments_registration_name = 'AdminComment'
126 | #
127 | # You can change the order for the comments and you can change the column
128 | # to be used for ordering:
129 | # config.comments_order = 'created_at ASC'
130 | #
131 | # You can disable the menu item for the comments index page:
132 | # config.comments_menu = false
133 | #
134 | # You can customize the comment menu:
135 | # config.comments_menu = { parent: 'Admin', priority: 1 }
136 |
137 | # == Batch Actions
138 | #
139 | # Enable and disable Batch Actions
140 | #
141 | config.batch_actions = true
142 |
143 | # == Controller Filters
144 | #
145 | # You can add before, after and around filters to all of your
146 | # Active Admin resources and pages from here.
147 | #
148 | # config.before_filter :do_something_awesome
149 |
150 | # == Localize Date/Time Format
151 | #
152 | # Set the localize format to display dates and times.
153 | # To understand how to localize your app with I18n, read more at
154 | # https://github.com/svenfuchs/i18n/blob/master/lib%2Fi18n%2Fbackend%2Fbase.rb#L52
155 | #
156 | config.localize_format = :long
157 |
158 | # == Setting a Favicon
159 | #
160 | # config.favicon = 'favicon.ico'
161 |
162 | # == Meta Tags
163 | #
164 | # Add additional meta tags to the head element of active admin pages.
165 | #
166 | # Add tags to all pages logged in users see:
167 | # config.meta_tags = { author: 'My Company' }
168 |
169 | # By default, sign up/sign in/recover password pages are excluded
170 | # from showing up in search engine results by adding a robots meta
171 | # tag. You can reset the hash of meta tags included in logged out
172 | # pages:
173 | # config.meta_tags_for_logged_out_pages = {}
174 |
175 | # == Removing Breadcrumbs
176 | #
177 | # Breadcrumbs are enabled by default. You can customize them for individual
178 | # resources or you can disable them globally from here.
179 | #
180 | # config.breadcrumb = false
181 |
182 | # == Register Stylesheets & Javascripts
183 | #
184 | # We recommend using the built in Active Admin layout and loading
185 | # up your own stylesheets / javascripts to customize the look
186 | # and feel.
187 | #
188 | # To load a stylesheet:
189 | # config.register_stylesheet 'my_stylesheet.css'
190 | #
191 | # You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
192 | # config.register_stylesheet 'my_print_stylesheet.css', media: :print
193 | #
194 | # To load a javascript file:
195 | # config.register_javascript 'my_javascript.js'
196 |
197 | # == CSV options
198 | #
199 | # Set the CSV builder separator
200 | # config.csv_options = { col_sep: ';' }
201 | #
202 | # Force the use of quotes
203 | # config.csv_options = { force_quotes: true }
204 |
205 | # == Menu System
206 | #
207 | # You can add a navigation menu to be used in your application, or configure a provided menu
208 | #
209 | # To change the default utility navigation to show a link to your website & a logout btn
210 | #
211 | # config.namespace :admin do |admin|
212 | # admin.build_menu :utility_navigation do |menu|
213 | # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
214 | # admin.add_logout_button_to_menu menu
215 | # end
216 | # end
217 | #
218 | # If you wanted to add a static menu item to the default menu provided:
219 | #
220 | # config.namespace :admin do |admin|
221 | # admin.build_menu :default do |menu|
222 | # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
223 | # end
224 | # end
225 |
226 | # == Download Links
227 | #
228 | # You can disable download links on resource listing pages,
229 | # or customize the formats shown per namespace/globally
230 | #
231 | # To disable/customize for the :admin namespace:
232 | #
233 | # config.namespace :admin do |admin|
234 | #
235 | # # Disable the links entirely
236 | # admin.download_links = false
237 | #
238 | # # Only show XML & PDF options
239 | # admin.download_links = [:xml, :pdf]
240 | #
241 | # # Enable/disable the links based on block
242 | # # (for example, with cancan)
243 | # admin.download_links = proc { can?(:view_download_links) }
244 | #
245 | # end
246 |
247 | # == Pagination
248 | #
249 | # Pagination is enabled by default for all resources.
250 | # You can control the default per page count for all resources here.
251 | #
252 | # config.default_per_page = 30
253 | #
254 | # You can control the max per page count too.
255 | #
256 | # config.max_per_page = 10_000
257 |
258 | # == Filters
259 | #
260 | # By default the index screen includes a "Filters" sidebar on the right
261 | # hand side with a filter for each attribute of the registered model.
262 | # You can enable or disable them for all resources here.
263 | #
264 | # config.filters = true
265 | #
266 | # By default the filters include associations in a select, which means
267 | # that every record will be loaded for each association.
268 | # You can enabled or disable the inclusion
269 | # of those filters by default here.
270 | #
271 | # config.include_default_association_filters = true
272 | end
273 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/assets.rb:
--------------------------------------------------------------------------------
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 | # Precompile additional assets.
7 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
8 | # Rails.application.config.assets.precompile += %w( search.js )
9 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
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!
8 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.action_dispatch.cookies_serializer = :json
--------------------------------------------------------------------------------
/test/dummy/config/initializers/devise.rb:
--------------------------------------------------------------------------------
1 | # Use this hook to configure devise mailer, warden hooks and so forth.
2 | # Many of these configuration options can be set straight in your model.
3 | Devise.setup do |config|
4 | # The secret key used by Devise. Devise uses this key to generate
5 | # random tokens. Changing this key will render invalid all existing
6 | # confirmation, reset password and unlock tokens in the database.
7 | # Devise will use the `secret_key_base` as its `secret_key`
8 | # by default. You can change it below and use your own secret key.
9 | # config.secret_key = '225572adea312852008aaed5dc97fc69e45c796aeda177d3ee7a6ea9f6ed8308f557af674ed9e593b5525b0cd0b9466e8ed2b92096c8caca09bc6c93e32121b6'
10 |
11 | # ==> Mailer Configuration
12 | # Configure the e-mail address which will be shown in Devise::Mailer,
13 | # note that it will be overwritten if you use your own mailer class
14 | # with default "from" parameter.
15 | config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
16 |
17 | # Configure the class responsible to send e-mails.
18 | # config.mailer = 'Devise::Mailer'
19 |
20 | # Configure the parent class responsible to send e-mails.
21 | # config.parent_mailer = 'ActionMailer::Base'
22 |
23 | # ==> ORM configuration
24 | # Load and configure the ORM. Supports :active_record (default) and
25 | # :mongoid (bson_ext recommended) by default. Other ORMs may be
26 | # available as additional gems.
27 | require 'devise/orm/active_record'
28 |
29 | # ==> Configuration for any authentication mechanism
30 | # Configure which keys are used when authenticating a user. The default is
31 | # just :email. You can configure it to use [:username, :subdomain], so for
32 | # authenticating a user, both parameters are required. Remember that those
33 | # parameters are used only when authenticating and not when retrieving from
34 | # session. If you need permissions, you should implement that in a before filter.
35 | # You can also supply a hash where the value is a boolean determining whether
36 | # or not authentication should be aborted when the value is not present.
37 | # config.authentication_keys = [:email]
38 |
39 | # Configure parameters from the request object used for authentication. Each entry
40 | # given should be a request method and it will automatically be passed to the
41 | # find_for_authentication method and considered in your model lookup. For instance,
42 | # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
43 | # The same considerations mentioned for authentication_keys also apply to request_keys.
44 | # config.request_keys = []
45 |
46 | # Configure which authentication keys should be case-insensitive.
47 | # These keys will be downcased upon creating or modifying a user and when used
48 | # to authenticate or find a user. Default is :email.
49 | config.case_insensitive_keys = [:email]
50 |
51 | # Configure which authentication keys should have whitespace stripped.
52 | # These keys will have whitespace before and after removed upon creating or
53 | # modifying a user and when used to authenticate or find a user. Default is :email.
54 | config.strip_whitespace_keys = [:email]
55 |
56 | # Tell if authentication through request.params is enabled. True by default.
57 | # It can be set to an array that will enable params authentication only for the
58 | # given strategies, for example, `config.params_authenticatable = [:database]` will
59 | # enable it only for database (email + password) authentication.
60 | # config.params_authenticatable = true
61 |
62 | # Tell if authentication through HTTP Auth is enabled. False by default.
63 | # It can be set to an array that will enable http authentication only for the
64 | # given strategies, for example, `config.http_authenticatable = [:database]` will
65 | # enable it only for database authentication. The supported strategies are:
66 | # :database = Support basic authentication with authentication key + password
67 | # config.http_authenticatable = false
68 |
69 | # If 401 status code should be returned for AJAX requests. True by default.
70 | # config.http_authenticatable_on_xhr = true
71 |
72 | # The realm used in Http Basic Authentication. 'Application' by default.
73 | # config.http_authentication_realm = 'Application'
74 |
75 | # It will change confirmation, password recovery and other workflows
76 | # to behave the same regardless if the e-mail provided was right or wrong.
77 | # Does not affect registerable.
78 | # config.paranoid = true
79 |
80 | # By default Devise will store the user in session. You can skip storage for
81 | # particular strategies by setting this option.
82 | # Notice that if you are skipping storage for all authentication paths, you
83 | # may want to disable generating routes to Devise's sessions controller by
84 | # passing skip: :sessions to `devise_for` in your config/routes.rb
85 | config.skip_session_storage = [:http_auth]
86 |
87 | # By default, Devise cleans up the CSRF token on authentication to
88 | # avoid CSRF token fixation attacks. This means that, when using AJAX
89 | # requests for sign in and sign up, you need to get a new CSRF token
90 | # from the server. You can disable this option at your own risk.
91 | # config.clean_up_csrf_token_on_authentication = true
92 |
93 | # When false, Devise will not attempt to reload routes on eager load.
94 | # This can reduce the time taken to boot the app but if your application
95 | # requires the Devise mappings to be loaded during boot time the application
96 | # won't boot properly.
97 | # config.reload_routes = true
98 |
99 | # ==> Configuration for :database_authenticatable
100 | # For bcrypt, this is the cost for hashing the password and defaults to 11. If
101 | # using other algorithms, it sets how many times you want the password to be hashed.
102 | #
103 | # Limiting the stretches to just one in testing will increase the performance of
104 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
105 | # a value less than 10 in other environments. Note that, for bcrypt (the default
106 | # algorithm), the cost increases exponentially with the number of stretches (e.g.
107 | # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
108 | config.stretches = Rails.env.test? ? 1 : 11
109 |
110 | # Set up a pepper to generate the hashed password.
111 | # config.pepper = '2a42c31f0a00605698f03a17e9071b40bef61592efa7cc7da0a360de86447058b84aa77bf1c18722251d18822b745d211156c5d0ac4f6f5a6d191362f2f2a347'
112 |
113 | # Send a notification email when the user's password is changed
114 | # config.send_password_change_notification = false
115 |
116 | # ==> Configuration for :confirmable
117 | # A period that the user is allowed to access the website even without
118 | # confirming their account. For instance, if set to 2.days, the user will be
119 | # able to access the website for two days without confirming their account,
120 | # access will be blocked just in the third day. Default is 0.days, meaning
121 | # the user cannot access the website without confirming their account.
122 | # config.allow_unconfirmed_access_for = 2.days
123 |
124 | # A period that the user is allowed to confirm their account before their
125 | # token becomes invalid. For example, if set to 3.days, the user can confirm
126 | # their account within 3 days after the mail was sent, but on the fourth day
127 | # their account can't be confirmed with the token any more.
128 | # Default is nil, meaning there is no restriction on how long a user can take
129 | # before confirming their account.
130 | # config.confirm_within = 3.days
131 |
132 | # If true, requires any email changes to be confirmed (exactly the same way as
133 | # initial account confirmation) to be applied. Requires additional unconfirmed_email
134 | # db field (see migrations). Until confirmed, new email is stored in
135 | # unconfirmed_email column, and copied to email column on successful confirmation.
136 | config.reconfirmable = true
137 |
138 | # Defines which key will be used when confirming an account
139 | # config.confirmation_keys = [:email]
140 |
141 | # ==> Configuration for :rememberable
142 | # The time the user will be remembered without asking for credentials again.
143 | # config.remember_for = 2.weeks
144 |
145 | # Invalidates all the remember me tokens when the user signs out.
146 | config.expire_all_remember_me_on_sign_out = true
147 |
148 | # If true, extends the user's remember period when remembered via cookie.
149 | # config.extend_remember_period = false
150 |
151 | # Options to be passed to the created cookie. For instance, you can set
152 | # secure: true in order to force SSL only cookies.
153 | # config.rememberable_options = {}
154 |
155 | # ==> Configuration for :validatable
156 | # Range for password length.
157 | config.password_length = 6..128
158 |
159 | # Email regex used to validate email formats. It simply asserts that
160 | # one (and only one) @ exists in the given string. This is mainly
161 | # to give user feedback and not to assert the e-mail validity.
162 | config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
163 |
164 | # ==> Configuration for :timeoutable
165 | # The time you want to timeout the user session without activity. After this
166 | # time the user will be asked for credentials again. Default is 30 minutes.
167 | # config.timeout_in = 30.minutes
168 |
169 | # ==> Configuration for :lockable
170 | # Defines which strategy will be used to lock an account.
171 | # :failed_attempts = Locks an account after a number of failed attempts to sign in.
172 | # :none = No lock strategy. You should handle locking by yourself.
173 | # config.lock_strategy = :failed_attempts
174 |
175 | # Defines which key will be used when locking and unlocking an account
176 | # config.unlock_keys = [:email]
177 |
178 | # Defines which strategy will be used to unlock an account.
179 | # :email = Sends an unlock link to the user email
180 | # :time = Re-enables login after a certain amount of time (see :unlock_in below)
181 | # :both = Enables both strategies
182 | # :none = No unlock strategy. You should handle unlocking by yourself.
183 | # config.unlock_strategy = :both
184 |
185 | # Number of authentication tries before locking an account if lock_strategy
186 | # is failed attempts.
187 | # config.maximum_attempts = 20
188 |
189 | # Time interval to unlock the account if :time is enabled as unlock_strategy.
190 | # config.unlock_in = 1.hour
191 |
192 | # Warn on the last attempt before the account is locked.
193 | # config.last_attempt_warning = true
194 |
195 | # ==> Configuration for :recoverable
196 | #
197 | # Defines which key will be used when recovering the password for an account
198 | # config.reset_password_keys = [:email]
199 |
200 | # Time interval you can reset your password with a reset password key.
201 | # Don't put a too small interval or your users won't have the time to
202 | # change their passwords.
203 | config.reset_password_within = 6.hours
204 |
205 | # When set to false, does not sign a user in automatically after their password is
206 | # reset. Defaults to true, so a user is signed in automatically after a reset.
207 | # config.sign_in_after_reset_password = true
208 |
209 | # ==> Configuration for :encryptable
210 | # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
211 | # You can use :sha1, :sha512 or algorithms from others authentication tools as
212 | # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
213 | # for default behavior) and :restful_authentication_sha1 (then you should set
214 | # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
215 | #
216 | # Require the `devise-encryptable` gem when using anything other than bcrypt
217 | # config.encryptor = :sha512
218 |
219 | # ==> Scopes configuration
220 | # Turn scoped views on. Before rendering "sessions/new", it will first check for
221 | # "users/sessions/new". It's turned off by default because it's slower if you
222 | # are using only default views.
223 | # config.scoped_views = false
224 |
225 | # Configure the default scope given to Warden. By default it's the first
226 | # devise role declared in your routes (usually :user).
227 | # config.default_scope = :user
228 |
229 | # Set this configuration to false if you want /users/sign_out to sign out
230 | # only the current scope. By default, Devise signs out all scopes.
231 | # config.sign_out_all_scopes = true
232 |
233 | # ==> Navigation configuration
234 | # Lists the formats that should be treated as navigational. Formats like
235 | # :html, should redirect to the sign in page when the user does not have
236 | # access, but formats like :xml or :json, should return 401.
237 | #
238 | # If you have any extra navigational formats, like :iphone or :mobile, you
239 | # should add them to the navigational formats lists.
240 | #
241 | # The "*/*" below is required to match Internet Explorer requests.
242 | # config.navigational_formats = ['*/*', :html]
243 |
244 | # The default HTTP method used to sign out a resource. Default is :delete.
245 | config.sign_out_via = :delete
246 |
247 | # ==> OmniAuth
248 | # Add a new OmniAuth provider. Check the wiki for more information on setting
249 | # up on your models and hooks.
250 | # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
251 |
252 | # ==> Warden configuration
253 | # If you want to use other strategies, that are not supported by Devise, or
254 | # change the failure app, you can configure them inside the config.warden block.
255 | #
256 | # config.warden do |manager|
257 | # manager.intercept_401 = false
258 | # manager.default_strategies(scope: :user).unshift :some_external_strategy
259 | # end
260 |
261 | # ==> Mountable engine configurations
262 | # When using Devise inside an engine, let's call it `MyEngine`, and this engine
263 | # is mountable, there are some extra configurations to be taken into account.
264 | # The following options are available, assuming the engine is mounted as:
265 | #
266 | # mount MyEngine, at: '/my_engine'
267 | #
268 | # The router that invoked `devise_for`, in the example above, would be:
269 | # config.router_name = :my_engine
270 | #
271 | # When using OmniAuth, Devise cannot automatically set OmniAuth path,
272 | # so you need to do it manually. For the users scope, it would be:
273 | # config.omniauth_path_prefix = '/my_engine/users/auth'
274 | end
275 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
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]
5 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
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
17 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
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
5 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.session_store :cookie_store, key: '_dummy_session'
4 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
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
15 |
--------------------------------------------------------------------------------
/test/dummy/config/locales/devise.en.yml:
--------------------------------------------------------------------------------
1 | # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2 |
3 | en:
4 | devise:
5 | confirmations:
6 | confirmed: "Your email address has been successfully confirmed."
7 | send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8 | send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9 | failure:
10 | already_authenticated: "You are already signed in."
11 | inactive: "Your account is not activated yet."
12 | invalid: "Invalid %{authentication_keys} or password."
13 | locked: "Your account is locked."
14 | last_attempt: "You have one more attempt before your account is locked."
15 | not_found_in_database: "Invalid %{authentication_keys} or password."
16 | timeout: "Your session expired. Please sign in again to continue."
17 | unauthenticated: "You need to sign in or sign up before continuing."
18 | unconfirmed: "You have to confirm your email address before continuing."
19 | mailer:
20 | confirmation_instructions:
21 | subject: "Confirmation instructions"
22 | reset_password_instructions:
23 | subject: "Reset password instructions"
24 | unlock_instructions:
25 | subject: "Unlock instructions"
26 | password_change:
27 | subject: "Password Changed"
28 | omniauth_callbacks:
29 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
30 | success: "Successfully authenticated from %{kind} account."
31 | passwords:
32 | no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
33 | send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
34 | send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
35 | updated: "Your password has been changed successfully. You are now signed in."
36 | updated_not_active: "Your password has been changed successfully."
37 | registrations:
38 | destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
39 | signed_up: "Welcome! You have signed up successfully."
40 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
41 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
42 | signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
43 | update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
44 | updated: "Your account has been updated successfully."
45 | sessions:
46 | signed_in: "Signed in successfully."
47 | signed_out: "Signed out successfully."
48 | already_signed_out: "Signed out successfully."
49 | unlocks:
50 | send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
51 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
52 | unlocked: "Your account has been unlocked successfully. Please sign in to continue."
53 | errors:
54 | messages:
55 | already_confirmed: "was already confirmed, please try signing in"
56 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
57 | expired: "has expired, please request a new one"
58 | not_found: "not found"
59 | not_locked: "was not locked"
60 | not_saved:
61 | one: "1 error prohibited this %{resource} from being saved:"
62 | other: "%{count} errors prohibited this %{resource} from being saved:"
63 |
--------------------------------------------------------------------------------
/test/dummy/config/locales/en.yml:
--------------------------------------------------------------------------------
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"
24 |
--------------------------------------------------------------------------------
/test/dummy/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | devise_for :admin_users, ActiveAdmin::Devise.config
3 | ActiveAdmin.routes(self)
4 |
5 | root to: "admin/dashboard#index"
6 | end
7 |
--------------------------------------------------------------------------------
/test/dummy/config/secrets.yml:
--------------------------------------------------------------------------------
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: 794857f9d9e71f1ee6c7a3fc3b988a985547a25e7399986243cdcea2a38a3e546282ac542ee0cae1a181a9c812d5dcf511a133b8c3c213519665d7f20dc7d43c
15 |
16 | test:
17 | secret_key_base: dc9915bfd760bfc1a920c87edf5b54dbbb316a25a75d483be78e93782de241f087172f3158cc97efc39aa137f24df9ce376a6da9a463779efd23fd8f1b2e4478
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"] %>
23 |
--------------------------------------------------------------------------------
/test/dummy/db/migrate/20160824020116_devise_create_admin_users.rb:
--------------------------------------------------------------------------------
1 | class DeviseCreateAdminUsers < ActiveRecord::Migration
2 | def change
3 | create_table :admin_users do |t|
4 | ## Database authenticatable
5 | t.string :email, null: false, default: ""
6 | t.string :encrypted_password, null: false, default: ""
7 |
8 | ## Recoverable
9 | t.string :reset_password_token
10 | t.datetime :reset_password_sent_at
11 |
12 | ## Rememberable
13 | t.datetime :remember_created_at
14 |
15 | ## Trackable
16 | t.integer :sign_in_count, default: 0, null: false
17 | t.datetime :current_sign_in_at
18 | t.datetime :last_sign_in_at
19 | t.string :current_sign_in_ip
20 | t.string :last_sign_in_ip
21 |
22 | ## Confirmable
23 | # t.string :confirmation_token
24 | # t.datetime :confirmed_at
25 | # t.datetime :confirmation_sent_at
26 | # t.string :unconfirmed_email # Only if using reconfirmable
27 |
28 | ## Lockable
29 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
30 | # t.string :unlock_token # Only if unlock strategy is :email or :both
31 | # t.datetime :locked_at
32 |
33 |
34 | t.timestamps null: false
35 | end
36 |
37 | add_index :admin_users, :email, unique: true
38 | add_index :admin_users, :reset_password_token, unique: true
39 | # add_index :admin_users, :confirmation_token, unique: true
40 | # add_index :admin_users, :unlock_token, unique: true
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/test/dummy/db/migrate/20160824020118_create_active_admin_comments.rb:
--------------------------------------------------------------------------------
1 | class CreateActiveAdminComments < ActiveRecord::Migration
2 | def self.up
3 | create_table :active_admin_comments do |t|
4 | t.string :namespace
5 | t.text :body
6 | t.string :resource_id, null: false
7 | t.string :resource_type, null: false
8 | t.references :author, polymorphic: true
9 | t.timestamps
10 | end
11 | add_index :active_admin_comments, [:namespace]
12 | add_index :active_admin_comments, [:author_type, :author_id]
13 | add_index :active_admin_comments, [:resource_type, :resource_id]
14 | end
15 |
16 | def self.down
17 | drop_table :active_admin_comments
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/test/dummy/db/schema.rb:
--------------------------------------------------------------------------------
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: 20160824020118) do
15 |
16 | create_table "active_admin_comments", force: :cascade do |t|
17 | t.string "namespace"
18 | t.text "body"
19 | t.string "resource_id", null: false
20 | t.string "resource_type", null: false
21 | t.integer "author_id"
22 | t.string "author_type"
23 | t.datetime "created_at"
24 | t.datetime "updated_at"
25 | end
26 |
27 | add_index "active_admin_comments", ["author_type", "author_id"], name: "index_active_admin_comments_on_author_type_and_author_id"
28 | add_index "active_admin_comments", ["namespace"], name: "index_active_admin_comments_on_namespace"
29 | add_index "active_admin_comments", ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource_type_and_resource_id"
30 |
31 | create_table "admin_users", force: :cascade do |t|
32 | t.string "email", default: "", null: false
33 | t.string "encrypted_password", default: "", null: false
34 | t.string "reset_password_token"
35 | t.datetime "reset_password_sent_at"
36 | t.datetime "remember_created_at"
37 | t.integer "sign_in_count", default: 0, null: false
38 | t.datetime "current_sign_in_at"
39 | t.datetime "last_sign_in_at"
40 | t.string "current_sign_in_ip"
41 | t.string "last_sign_in_ip"
42 | t.datetime "created_at", null: false
43 | t.datetime "updated_at", null: false
44 | end
45 |
46 | add_index "admin_users", ["email"], name: "index_admin_users_on_email", unique: true
47 | add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
48 |
49 | end
50 |
--------------------------------------------------------------------------------
/test/dummy/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # This file should contain all the record creation needed to seed the database with its default values.
2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
3 | #
4 | # Examples:
5 | #
6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7 | # Character.create(name: 'Luke', movie: movies.first)
8 | users = [
9 | { email: 'admin@example.com', password: 'password', password_confirmation: 'password'},
10 | ]
11 |
12 | users.each do |v|
13 | user_created = AdminUser.where(email: v[:email]).first_or_initialize(v)
14 | if user_created.valid? && user_created.new_record?
15 | user_created.save!
16 | puts "User created! email: #{user_created.email} - password: #{user_created.password}"
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/test/dummy/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/test/dummy/lib/assets/.keep
--------------------------------------------------------------------------------
/test/dummy/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/test/dummy/log/.keep
--------------------------------------------------------------------------------
/test/dummy/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The page you were looking for doesn't exist.
62 |
You may have mistyped the address or the page may have moved.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/test/dummy/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The change you wanted was rejected (422)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The change you wanted was rejected.
62 |
Maybe you tried to change something you didn't have access to.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/test/dummy/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | We're sorry, but something went wrong (500)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
We're sorry, but something went wrong.
62 |
63 |
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/test/dummy/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/test/dummy/public/favicon.ico
--------------------------------------------------------------------------------
/test/dummy/test/fixtures/admin_users.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | # This model initially had no columns defined. If you add columns to the
4 | # model remove the '{}' from the fixture names and add the columns immediately
5 | # below each fixture, per the syntax in the comments below
6 | #
7 | one: {}
8 | # column: value
9 | #
10 | two: {}
11 | # column: value
12 |
--------------------------------------------------------------------------------
/test/dummy/test/models/admin_user_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class AdminUserTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/integration/navigation_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class NavigationTest < ActionDispatch::IntegrationTest
4 | fixtures :all
5 |
6 | # test "the truth" do
7 | # assert true
8 | # end
9 | end
10 |
11 |
--------------------------------------------------------------------------------
/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # Configure Rails Environment
2 | ENV["RAILS_ENV"] = "test"
3 |
4 | require File.expand_path("../dummy/config/environment.rb", __FILE__)
5 | require "rails/test_help"
6 |
7 | Rails.backtrace_cleaner.remove_silencers!
8 |
9 | # Load support files
10 | Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11 |
12 | # Load fixtures from the engine
13 | if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14 | ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15 | end
16 |
--------------------------------------------------------------------------------
/vendor/doc/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/vendor/doc/1.png
--------------------------------------------------------------------------------
/vendor/doc/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/vendor/doc/2.png
--------------------------------------------------------------------------------
/vendor/doc/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/vendor/doc/3.png
--------------------------------------------------------------------------------
/vendor/doc/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bys-control/activeadmin-ajax_forms/a6858266f4a794a723821c124e9ac15a62dafb13/vendor/doc/4.png
--------------------------------------------------------------------------------
/webpack/build/build.js:
--------------------------------------------------------------------------------
1 | // https://github.com/shelljs/shelljs
2 | require('shelljs/global')
3 | env.NODE_ENV = 'production'
4 |
5 | var path = require('path')
6 | var config = require('../config')
7 | var ora = require('ora')
8 | var webpack = require('webpack')
9 | var webpackConfig = require('./webpack.prod.conf')
10 |
11 | console.log(
12 | ' Tip:\n' +
13 | ' Built files are meant to be served over an HTTP server.\n' +
14 | ' Opening index.html over file:// won\'t work.\n'
15 | )
16 |
17 | var spinner = ora('building for production...')
18 | spinner.start()
19 |
20 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
21 | rm('-rf', assetsPath)
22 | mkdir('-p', assetsPath)
23 | cp('-R', 'static/', assetsPath)
24 |
25 | webpack(webpackConfig, function (err, stats) {
26 | spinner.stop()
27 | if (err) throw err
28 | process.stdout.write(stats.toString({
29 | colors: true,
30 | modules: false,
31 | children: false,
32 | chunks: false,
33 | chunkModules: false
34 | }) + '\n')
35 | })
36 |
--------------------------------------------------------------------------------
/webpack/build/dev-client.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | require('eventsource-polyfill')
3 | var hotClient = require('webpack-hot-middleware/client?path=http://localhost:8080/__webpack_hmr&noInfo=true&reload=true')
4 |
5 | hotClient.subscribe(function (event) {
6 | if (event.action === 'reload') {
7 | window.location.reload()
8 | }
9 | })
10 |
--------------------------------------------------------------------------------
/webpack/build/dev-server.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var express = require('express')
3 | var webpack = require('webpack')
4 | var config = require('../config')
5 | var proxyMiddleware = require('http-proxy-middleware')
6 | var webpackConfig = process.env.NODE_ENV === 'testing'
7 | ? require('./webpack.prod.conf')
8 | : require('./webpack.dev.conf')
9 |
10 | // default port where dev server listens for incoming traffic
11 | var port = config.dev.port || process.env.PORT
12 | // Define HTTP proxies to your custom API backend
13 | // https://github.com/chimurai/http-proxy-middleware
14 | var proxyTable = config.dev.proxyTable
15 |
16 | var app = express()
17 | var compiler = webpack(webpackConfig)
18 |
19 | var devMiddleware = require('webpack-dev-middleware')(compiler, {
20 | publicPath: webpackConfig.output.publicPath,
21 | stats: {
22 | colors: true,
23 | chunks: false
24 | }
25 | })
26 |
27 | var hotMiddleware = require('webpack-hot-middleware')(compiler)
28 | // force page reload when html-webpack-plugin template changes
29 | compiler.plugin('compilation', function (compilation) {
30 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
31 | hotMiddleware.publish({ action: 'reload' })
32 | cb()
33 | })
34 | })
35 |
36 | // proxy api requests
37 | Object.keys(proxyTable).forEach(function (context) {
38 | var options = proxyTable[context]
39 | if (typeof options === 'string') {
40 | options = { target: options }
41 | }
42 | app.use(proxyMiddleware(context, options))
43 | })
44 |
45 | // handle fallback for HTML5 history API
46 | app.use(require('connect-history-api-fallback')())
47 |
48 | // serve webpack bundle output
49 | app.use(devMiddleware)
50 |
51 | // enable hot-reload and state-preserving
52 | // compilation error display
53 | app.use(hotMiddleware)
54 |
55 | // serve pure static assets
56 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
57 | app.use(staticPath, express.static('./static'))
58 |
59 | module.exports = app.listen(port, function (err) {
60 | if (err) {
61 | console.log(err)
62 | return
63 | }
64 | console.log('Listening at http://localhost:' + port + '\n')
65 | })
66 |
--------------------------------------------------------------------------------
/webpack/build/utils.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var config = require('../config')
3 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
4 |
5 | exports.assetsPath = function (_path) {
6 | return path.posix.join(config.build.assetsSubDirectory, _path)
7 | }
8 |
9 | exports.cssLoaders = function (options) {
10 | options = options || {}
11 | // generate loader string to be used with extract text plugin
12 | function generateLoaders (loaders) {
13 | var sourceLoader = loaders.map(function (loader) {
14 | var extraParamChar
15 | if (/\?/.test(loader)) {
16 | loader = loader.replace(/\?/, '-loader?')
17 | extraParamChar = '&'
18 | } else {
19 | loader = loader + '-loader'
20 | extraParamChar = '?'
21 | }
22 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '')
23 | }).join('!')
24 |
25 | if (options.extract) {
26 | return ExtractTextPlugin.extract('vue-style-loader', sourceLoader)
27 | } else {
28 | return ['vue-style-loader', sourceLoader].join('!')
29 | }
30 | }
31 |
32 | // http://vuejs.github.io/vue-loader/configurations/extract-css.html
33 | return {
34 | css: generateLoaders(['css']),
35 | postcss: generateLoaders(['css']),
36 | less: generateLoaders(['css', 'less']),
37 | sass: generateLoaders(['css', 'sass?indentedSyntax']),
38 | scss: generateLoaders(['css', 'sass']),
39 | stylus: generateLoaders(['css', 'stylus']),
40 | styl: generateLoaders(['css', 'stylus'])
41 | }
42 | }
43 |
44 | // Generate loaders for standalone style files (outside of .vue)
45 | exports.styleLoaders = function (options) {
46 | var output = []
47 | var loaders = exports.cssLoaders(options)
48 | for (var extension in loaders) {
49 | var loader = loaders[extension]
50 | output.push({
51 | test: new RegExp('\\.' + extension + '$'),
52 | loader: loader
53 | })
54 | }
55 | return output
56 | }
57 |
--------------------------------------------------------------------------------
/webpack/build/webpack.base.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var config = require('../config')
3 | var utils = require('./utils')
4 | var projectRoot = path.resolve(__dirname, '../../')
5 |
6 | module.exports = {
7 | entry: {
8 | app: './app/assets/javascripts/application.js'
9 | },
10 | output: {
11 | path: config.build.assetsRoot,
12 | publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
13 | filename: '[name].js'
14 | },
15 | resolve: {
16 | extensions: ['', '.cofee', '.js', '.vue'],
17 | fallback: [path.join(__dirname, '../node_modules')],
18 | alias: {
19 | 'src': path.resolve(__dirname, '../../app/assets/javascripts'),
20 | 'assets': path.resolve(__dirname, '../../app/assets')
21 | }
22 | },
23 | resolveLoader: {
24 | fallback: [path.join(__dirname, '../node_modules')]
25 | },
26 | module: {
27 | preLoaders: [
28 | {
29 | test: /\.vue$/,
30 | loader: 'eslint',
31 | include: projectRoot,
32 | exclude: /node_modules/
33 | },
34 | {
35 | test: /\.js$/,
36 | loader: 'eslint',
37 | include: projectRoot,
38 | exclude: /(node_modules)/
39 | }
40 | ],
41 | loaders: [
42 | {
43 | test: /\.vue$/,
44 | loader: 'vue'
45 | },
46 | {
47 | test: /\.js$/,
48 | loader: 'babel',
49 | include: projectRoot,
50 | exclude: /(node_modules)/
51 | },
52 | {
53 | test: /\.json$/,
54 | loader: 'json'
55 | },
56 | {
57 | test: /\.html$/,
58 | loader: 'vue-html'
59 | },
60 | {
61 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
62 | loader: 'url',
63 | query: {
64 | limit: 10000,
65 | name: utils.assetsPath('img/[name].[hash:7].[ext]')
66 | }
67 | },
68 | {
69 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
70 | loader: 'url',
71 | query: {
72 | limit: 10000,
73 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
74 | }
75 | },
76 | // **IMPORTANT** This is needed so that each bootstrap js file required by
77 | // bootstrap-webpack has access to the jQuery object
78 | { test: /bootstrap\/js\//, loader: 'imports?jQuery=jquery' },
79 | { test: /\.coffee$/, loader: 'coffee-loader' },
80 | { test: /\.(coffee\.md|litcoffee)$/, loader: 'coffee-loader?literate' }
81 | ]
82 | },
83 | eslint: {
84 | formatter: require('eslint-friendly-formatter')
85 | },
86 | vue: {
87 | loaders: utils.cssLoaders()
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/webpack/build/webpack.dev.conf.js:
--------------------------------------------------------------------------------
1 | var config = require('../config')
2 | var webpack = require('webpack')
3 | var merge = require('webpack-merge')
4 | var utils = require('./utils')
5 | var baseWebpackConfig = require('./webpack.base.conf')
6 | var HtmlWebpackPlugin = require('html-webpack-plugin')
7 | var NpmInstallPlugin = require('npm-install-webpack-plugin')
8 |
9 | // add hot-reload related code to entry chunks
10 | Object.keys(baseWebpackConfig.entry).forEach(function (name) {
11 | baseWebpackConfig.entry[name] = ['./webpack/build/dev-client'].concat(baseWebpackConfig.entry[name])
12 | })
13 |
14 | module.exports = merge(baseWebpackConfig, {
15 | module: {
16 | loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
17 | },
18 | // eval-source-map is faster for development
19 | devtool: '#eval-source-map',
20 | plugins: [
21 | new webpack.DefinePlugin({
22 | 'process.env': config.dev.env
23 | }),
24 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
25 | new webpack.optimize.OccurenceOrderPlugin(),
26 | new webpack.HotModuleReplacementPlugin(),
27 | new webpack.NoErrorsPlugin(),
28 | // https://github.com/ampedandwired/html-webpack-plugin
29 | new HtmlWebpackPlugin({
30 | filename: 'index.html',
31 | template: './webpack/index.html',
32 | inject: true
33 | }),
34 | new NpmInstallPlugin()
35 | ]
36 | })
37 |
--------------------------------------------------------------------------------
/webpack/build/webpack.prod.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var config = require('../config')
3 | var utils = require('./utils')
4 | var webpack = require('webpack')
5 | var merge = require('webpack-merge')
6 | var baseWebpackConfig = require('./webpack.base.conf')
7 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
8 | var HtmlWebpackPlugin = require('html-webpack-plugin')
9 | var env = process.env.NODE_ENV === 'testing'
10 | ? require('../config/test.env')
11 | : config.build.env
12 |
13 | var webpackConfig = merge(baseWebpackConfig, {
14 | module: {
15 | loaders: utils.styleLoaders({
16 | sourceMap: config.build.productionSourceMap,
17 | extract: false })
18 | },
19 | devtool: config.build.productionSourceMap ? '#source-map' : false,
20 | output: {
21 | path: config.build.assetsRoot,
22 | filename: utils.assetsPath('js/[name].[chunkhash].js'),
23 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
24 | },
25 | vue: {
26 | loaders: utils.cssLoaders({
27 | sourceMap: config.build.productionSourceMap,
28 | extract: true
29 | })
30 | },
31 | plugins: [
32 | // http://vuejs.github.io/vue-loader/workflow/production.html
33 | new webpack.DefinePlugin({
34 | 'process.env': env
35 | }),
36 | new webpack.optimize.UglifyJsPlugin({
37 | compress: {
38 | warnings: false
39 | }
40 | }),
41 | new webpack.optimize.OccurenceOrderPlugin(),
42 | // extract css into its own file
43 | new ExtractTextPlugin(utils.assetsPath('css/[name].[contenthash].css')),
44 | // generate dist index.html with correct asset hash for caching.
45 | // you can customize output by editing /index.html
46 | // see https://github.com/ampedandwired/html-webpack-plugin
47 | new HtmlWebpackPlugin({
48 | filename: process.env.NODE_ENV === 'testing'
49 | ? 'index.html'
50 | : config.build.index,
51 | template: 'index.html',
52 | inject: true,
53 | minify: {
54 | removeComments: true,
55 | collapseWhitespace: true,
56 | removeAttributeQuotes: true
57 | // more options:
58 | // https://github.com/kangax/html-minifier#options-quick-reference
59 | },
60 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin
61 | chunksSortMode: 'dependency'
62 | }),
63 | // split vendor js into its own file
64 | new webpack.optimize.CommonsChunkPlugin({
65 | name: 'vendor',
66 | minChunks: function (module, count) {
67 | // any required modules inside node_modules are extracted to vendor
68 | return (
69 | module.resource &&
70 | /\.js$/.test(module.resource) &&
71 | module.resource.indexOf(
72 | path.join(__dirname, '../node_modules')
73 | ) === 0
74 | )
75 | }
76 | }),
77 | // extract webpack runtime and module manifest to its own file in order to
78 | // prevent vendor hash from being updated whenever app bundle is updated
79 | new webpack.optimize.CommonsChunkPlugin({
80 | name: 'manifest',
81 | chunks: ['vendor']
82 | })
83 | ]
84 | })
85 |
86 | if (config.build.productionGzip) {
87 | var CompressionWebpackPlugin = require('compression-webpack-plugin')
88 |
89 | webpackConfig.plugins.push(
90 | new CompressionWebpackPlugin({
91 | asset: '[path].gz[query]',
92 | algorithm: 'gzip',
93 | test: new RegExp(
94 | '\\.(' +
95 | config.build.productionGzipExtensions.join('|') +
96 | ')$'
97 | ),
98 | threshold: 10240,
99 | minRatio: 0.8
100 | })
101 | )
102 | }
103 |
104 | module.exports = webpackConfig
105 |
--------------------------------------------------------------------------------
/webpack/config/dev.env.js:
--------------------------------------------------------------------------------
1 | var merge = require('webpack-merge')
2 | var prodEnv = require('./prod.env')
3 |
4 | module.exports = merge(prodEnv, {
5 | NODE_ENV: '"development"'
6 | })
7 |
--------------------------------------------------------------------------------
/webpack/config/index.js:
--------------------------------------------------------------------------------
1 | // see http://vuejs-templates.github.io/webpack for documentation.
2 | var path = require('path')
3 |
4 | module.exports = {
5 | build: {
6 | env: require('./prod.env'),
7 | index: path.resolve(__dirname, '../public/index.html'),
8 | assetsRoot: path.resolve(__dirname, '../public'),
9 | assetsSubDirectory: 'static',
10 | assetsPublicPath: '/',
11 | productionSourceMap: true,
12 | // Gzip off by default as many popular static hosts such as
13 | // Surge or Netlify already gzip all static assets for you.
14 | // Before setting to `true`, make sure to:
15 | // npm install --save-dev compression-webpack-plugin
16 | productionGzip: false,
17 | productionGzipExtensions: ['js', 'css']
18 | },
19 | dev: {
20 | env: require('./dev.env'),
21 | port: 8080,
22 | assetsSubDirectory: 'static',
23 | assetsPublicPath: 'http://localhost:8080/',
24 | proxyTable: {
25 | },
26 | // CSS Sourcemaps off by default because relative paths are "buggy"
27 | // with this option, according to the CSS-Loader README
28 | // (https://github.com/webpack/css-loader#sourcemaps)
29 | // In our experience, they generally work as expected,
30 | // just be aware of this issue when enabling this option.
31 | cssSourceMap: false
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/webpack/config/prod.env.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | NODE_ENV: '"production"'
3 | }
4 |
--------------------------------------------------------------------------------
/webpack/config/test.env.js:
--------------------------------------------------------------------------------
1 | var merge = require('webpack-merge')
2 | var devEnv = require('./dev.env')
3 |
4 | module.exports = merge(devEnv, {
5 | NODE_ENV: '"testing"'
6 | })
7 |
--------------------------------------------------------------------------------
/webpack/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | vue-test
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------