First working version with devise+rails_admin
This commit is contained in:
92
.idea/workspace.xml
generated
92
.idea/workspace.xml
generated
@@ -2,17 +2,28 @@
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="d6389a56-ae12-4279-bc1d-76334fb6e4f6" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/assets/stylesheets/pages.scss" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/controllers/pages_controller.rb" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/helpers/pages_helper.rb" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/javascript/stylesheets/application.scss" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/views/pages/home.html.erb" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/test/controllers/pages_controller_test.rb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Dockerfile" beforeDir="false" afterPath="$PROJECT_DIR$/Dockerfile" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Gemfile" beforeDir="false" afterPath="$PROJECT_DIR$/Gemfile" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Gemfile.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Gemfile.lock" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/javascript/packs/application.js" beforeDir="false" afterPath="$PROJECT_DIR$/app/javascript/packs/application.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/models/admin.rb" beforeDir="false" afterPath="$PROJECT_DIR$/app/models/admin.rb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/views/layouts/application.html.erb" beforeDir="false" afterPath="$PROJECT_DIR$/app/views/layouts/application.html.erb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/config/database.yml" beforeDir="false" afterPath="$PROJECT_DIR$/config/database.yml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/config/environments/development.rb" beforeDir="false" afterPath="$PROJECT_DIR$/config/environments/development.rb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/config/environments/production.rb" beforeDir="false" afterPath="$PROJECT_DIR$/config/environments/production.rb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/config/initializers/assets.rb" beforeDir="false" afterPath="$PROJECT_DIR$/config/initializers/assets.rb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/config/initializers/devise.rb" beforeDir="false" afterPath="$PROJECT_DIR$/config/initializers/devise.rb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/config/routes.rb" beforeDir="false" afterPath="$PROJECT_DIR$/config/routes.rb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/db/migrate/20200817200957_devise_create_admins.rb" beforeDir="false" afterPath="$PROJECT_DIR$/db/migrate/20200817200957_devise_create_admins.rb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/db/schema.rb" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/db/seeds.rb" beforeDir="false" afterPath="$PROJECT_DIR$/db/seeds.rb" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ss-calculator.iml" beforeDir="false" afterPath="$PROJECT_DIR$/ss-calculator.iml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/yarn.lock" beforeDir="false" afterPath="$PROJECT_DIR$/yarn.lock" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -22,6 +33,13 @@
|
||||
<component name="ComposerSettings">
|
||||
<execution />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="SCSS File" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
@@ -32,26 +50,33 @@
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="ASKED_ADD_EXTERNAL_FILES" value="true" />
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="aspect.path.notification.shown" value="true" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/docker-compose.yml" />
|
||||
<property name="list.type.of.created.stylesheet" value="SCSS" />
|
||||
<property name="node.js.detected.package.eslint" value="true" />
|
||||
<property name="node.js.detected.package.tslint" value="true" />
|
||||
<property name="node.js.path.for.package.eslint" value="project" />
|
||||
<property name="node.js.path.for.package.tslint" value="project" />
|
||||
<property name="node.js.selected.package.eslint" value="(autodetect)" />
|
||||
<property name="node.js.selected.package.tslint" value="(autodetect)" />
|
||||
<property name="project.structure.last.edited" value="Project" />
|
||||
<property name="project.structure.proportion" value="0.0" />
|
||||
<property name="project.structure.side.proportion" value="0.0" />
|
||||
<property name="settings.editor.selected.configurable" value="vcs.Git" />
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
|
||||
<configuration default="true" type="ArquillianTestNG" factoryName="" nameIsGenerated="true">
|
||||
<option name="arquillianRunConfiguration">
|
||||
<value>
|
||||
<option name="containerStateName" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="TEST_OBJECT" value="class" />
|
||||
<option name="TEST_OBJECT" value="CLASS" />
|
||||
<properties />
|
||||
<listeners />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
@@ -70,8 +95,24 @@
|
||||
</deployment>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="docker-compose.yml[db, web]: Compose Deployment" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
|
||||
<deployment type="docker-compose.yml">
|
||||
<settings>
|
||||
<option name="commandLineOptions" value="--build" />
|
||||
<option name="services">
|
||||
<list>
|
||||
<option value="db" />
|
||||
<option value="web" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="sourceFilePath" value="docker-compose.yml" />
|
||||
</settings>
|
||||
</deployment>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="true" RAILS_SPRING_PRE_LOADER_OPTION="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="d6389a56-ae12-4279-bc1d-76334fb6e4f6" name="Default Changelist" comment="" />
|
||||
@@ -79,26 +120,43 @@
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1597686467739</updated>
|
||||
<workItem from="1597686468787" duration="5114000" />
|
||||
<workItem from="1597686468787" duration="5768000" />
|
||||
<workItem from="1597747634273" duration="9261000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Install rails_admin and devise. Start setting it up.">
|
||||
<created>1597695591871</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1597695591871</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="2" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="Install rails_admin and devise. Start setting it up." />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Install rails_admin and devise. Start setting it up." />
|
||||
</component>
|
||||
<component name="WindowStateProjectService">
|
||||
<state x="552" y="178" key="#Docker" timestamp="1597687559241">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="552" y="178" key="#Docker/0.0.1920.1040/-1920.0.1740.1040@0.0.1920.1040" timestamp="1597687559241" />
|
||||
<state x="414" y="175" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1597687592049">
|
||||
<state x="440" y="94" key="#Project_Structure" timestamp="1597761418307">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="414" y="175" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1040/-1920.0.1740.1040@0.0.1920.1040" timestamp="1597687592049" />
|
||||
<state x="585" y="107" key="CommitChangelistDialog2" timestamp="1597695453721">
|
||||
<state x="440" y="94" key="#Project_Structure/0.0.1920.1040/-1920.0.1740.1040@0.0.1920.1040" timestamp="1597761418307" />
|
||||
<state x="414" y="175" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1597761256987">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="585" y="107" key="CommitChangelistDialog2/0.0.1920.1040/-1920.0.1740.1040@0.0.1920.1040" timestamp="1597695453721" />
|
||||
<state x="414" y="175" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1040/-1920.0.1740.1040@0.0.1920.1040" timestamp="1597761256987" />
|
||||
<state x="585" y="107" key="CommitChangelistDialog2" timestamp="1597695591093">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="585" y="107" key="CommitChangelistDialog2/0.0.1920.1040/-1920.0.1740.1040@0.0.1920.1040" timestamp="1597695591093" />
|
||||
<state x="798" y="388" key="DockerComposeFileDialog" timestamp="1597687575523">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
@@ -111,9 +169,21 @@
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="740" y="275" key="FileChooserDialogImpl/0.0.1920.1040/-1920.0.1740.1040@0.0.1920.1040" timestamp="1597687573558" />
|
||||
<state x="552" y="253" key="Vcs.Push.Dialog.v2" timestamp="1597695595550">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="552" y="253" key="Vcs.Push.Dialog.v2/0.0.1920.1040/-1920.0.1740.1040@0.0.1920.1040" timestamp="1597695595550" />
|
||||
<state x="832" y="364" key="cloudConfig.SelfSettingsDialog" timestamp="1597761380237">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="832" y="364" key="cloudConfig.SelfSettingsDialog/0.0.1920.1040/-1920.0.1740.1040@0.0.1920.1040" timestamp="1597761380237" />
|
||||
<state x="565" y="130" key="com.intellij.openapi.editor.actions.MultiplePasteAction$ClipboardContentChooser" timestamp="1597694693345">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="565" y="130" key="com.intellij.openapi.editor.actions.MultiplePasteAction$ClipboardContentChooser/0.0.1920.1040/-1920.0.1740.1040@0.0.1920.1040" timestamp="1597694693345" />
|
||||
<state x="667" y="253" width="585" height="534" key="find.popup" timestamp="1597750172554">
|
||||
<screen x="0" y="0" width="1920" height="1040" />
|
||||
</state>
|
||||
<state x="667" y="253" width="585" height="534" key="find.popup/0.0.1920.1040/-1920.0.1740.1040@0.0.1920.1040" timestamp="1597750172554" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -9,6 +9,7 @@ COPY Gemfile /myapp/Gemfile
|
||||
COPY Gemfile.lock /myapp/Gemfile.lock
|
||||
RUN bundle install
|
||||
COPY . /myapp
|
||||
RUN yarn install --check-files
|
||||
|
||||
# Add a script to be executed every time the container starts.
|
||||
COPY entrypoint.sh /usr/bin/
|
||||
|
||||
6
Gemfile
6
Gemfile
@@ -57,4 +57,8 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
||||
gem 'rails_admin', '~> 2.0'
|
||||
|
||||
# Auth with devise
|
||||
gem 'devise', '~> 4.7'
|
||||
gem 'devise', '~> 4.7'
|
||||
gem 'omniauth-github'
|
||||
gem 'omniauth-openid'
|
||||
gem 'omniauth-google-oauth2'
|
||||
gem 'omniauth-facebook'
|
||||
39
Gemfile.lock
39
Gemfile.lock
@@ -86,6 +86,8 @@ GEM
|
||||
responders
|
||||
warden (~> 1.2.3)
|
||||
erubi (1.9.0)
|
||||
faraday (1.0.1)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
ffi (1.13.1)
|
||||
ffi (1.13.1-x64-mingw32)
|
||||
globalid (0.4.2)
|
||||
@@ -93,6 +95,7 @@ GEM
|
||||
haml (5.1.2)
|
||||
temple (>= 0.8.0)
|
||||
tilt
|
||||
hashie (4.1.0)
|
||||
i18n (1.8.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
jbuilder (2.10.0)
|
||||
@@ -103,6 +106,7 @@ GEM
|
||||
thor (>= 0.14, < 2.0)
|
||||
jquery-ui-rails (6.0.1)
|
||||
railties (>= 3.2.16)
|
||||
jwt (2.2.2)
|
||||
kaminari (1.2.1)
|
||||
activesupport (>= 4.1.0)
|
||||
kaminari-actionview (= 1.2.1)
|
||||
@@ -132,12 +136,39 @@ GEM
|
||||
minitest (5.14.1)
|
||||
msgpack (1.3.3)
|
||||
msgpack (1.3.3-x64-mingw32)
|
||||
multi_json (1.15.0)
|
||||
multi_xml (0.6.0)
|
||||
multipart-post (2.1.1)
|
||||
nested_form (0.3.2)
|
||||
nio4r (2.5.2)
|
||||
nokogiri (1.10.10)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
nokogiri (1.10.10-x64-mingw32)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
oauth2 (1.4.4)
|
||||
faraday (>= 0.8, < 2.0)
|
||||
jwt (>= 1.0, < 3.0)
|
||||
multi_json (~> 1.3)
|
||||
multi_xml (~> 0.5)
|
||||
rack (>= 1.2, < 3)
|
||||
omniauth (1.9.1)
|
||||
hashie (>= 3.4.6)
|
||||
rack (>= 1.6.2, < 3)
|
||||
omniauth-facebook (6.0.0)
|
||||
omniauth-oauth2 (~> 1.2)
|
||||
omniauth-github (1.4.0)
|
||||
omniauth (~> 1.5)
|
||||
omniauth-oauth2 (>= 1.4.0, < 2.0)
|
||||
omniauth-google-oauth2 (0.8.0)
|
||||
jwt (>= 2.0)
|
||||
omniauth (>= 1.1.1)
|
||||
omniauth-oauth2 (>= 1.6)
|
||||
omniauth-oauth2 (1.7.0)
|
||||
oauth2 (~> 1.4)
|
||||
omniauth (~> 1.9)
|
||||
omniauth-openid (1.0.1)
|
||||
omniauth (~> 1.0)
|
||||
rack-openid (~> 1.3.1)
|
||||
orm_adapter (0.5.0)
|
||||
pg (1.2.3)
|
||||
pg (1.2.3-x64-mingw32)
|
||||
@@ -145,6 +176,9 @@ GEM
|
||||
puma (4.3.5)
|
||||
nio4r (~> 2.0)
|
||||
rack (2.2.3)
|
||||
rack-openid (1.3.1)
|
||||
rack (>= 1.1.0)
|
||||
ruby-openid (>= 2.1.8)
|
||||
rack-pjax (1.1.0)
|
||||
nokogiri (~> 1.5)
|
||||
rack (>= 1.1)
|
||||
@@ -199,6 +233,7 @@ GEM
|
||||
responders (3.0.1)
|
||||
actionpack (>= 5.0)
|
||||
railties (>= 5.0)
|
||||
ruby-openid (2.9.2)
|
||||
rubyzip (2.3.0)
|
||||
sass-rails (6.0.0)
|
||||
sassc-rails (~> 2.1, >= 2.1.1)
|
||||
@@ -270,6 +305,10 @@ DEPENDENCIES
|
||||
devise (~> 4.7)
|
||||
jbuilder (~> 2.7)
|
||||
listen (~> 3.2)
|
||||
omniauth-facebook
|
||||
omniauth-github
|
||||
omniauth-google-oauth2
|
||||
omniauth-openid
|
||||
pg (>= 0.18, < 2.0)
|
||||
puma (~> 4.1)
|
||||
rails (~> 6.0.3, >= 6.0.3.2)
|
||||
|
||||
3
app/assets/stylesheets/pages.scss
Normal file
3
app/assets/stylesheets/pages.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the pages controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: https://sass-lang.com/
|
||||
4
app/controllers/pages_controller.rb
Normal file
4
app/controllers/pages_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class PagesController < ApplicationController
|
||||
def home
|
||||
end
|
||||
end
|
||||
2
app/helpers/pages_helper.rb
Normal file
2
app/helpers/pages_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module PagesHelper
|
||||
end
|
||||
@@ -7,7 +7,8 @@ require("@rails/ujs").start()
|
||||
require("turbolinks").start()
|
||||
require("@rails/activestorage").start()
|
||||
require("channels")
|
||||
|
||||
global.toastr = require("toastr")
|
||||
import "../stylesheets/application"
|
||||
|
||||
// Uncomment to copy all static images under ../images to the output folder and reference
|
||||
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
|
||||
|
||||
1
app/javascript/stylesheets/application.scss
Normal file
1
app/javascript/stylesheets/application.scss
Normal file
@@ -0,0 +1 @@
|
||||
@import 'toastr'
|
||||
@@ -2,5 +2,6 @@ class Admin < ApplicationRecord
|
||||
# Include default devise modules. Others available are:
|
||||
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
|
||||
devise :database_authenticatable, :registerable,
|
||||
:recoverable, :rememberable, :validatable
|
||||
:recoverable, :rememberable, :validatable, :confirmable,
|
||||
:lockable, :timeoutable, :trackable, :omniauthable
|
||||
end
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<% unless flash.empty? %>
|
||||
<script type="text/javascript">
|
||||
<% flash.each do |f| %>
|
||||
<% type = f[0].to_s.gsub('alert', 'error').gsub('notice', 'info') %>
|
||||
toastr['<%= type %>']('<%= f[1] %>');
|
||||
<% end %>
|
||||
</script>
|
||||
<% end %>
|
||||
<p class="notice"><%= notice %></p>
|
||||
<p class="alert"><%= alert %></p>
|
||||
<%= yield %>
|
||||
|
||||
2
app/views/pages/home.html.erb
Normal file
2
app/views/pages/home.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>Pages#home</h1>
|
||||
<p>Find me in app/views/pages/home.html.erb</p>
|
||||
@@ -12,3 +12,9 @@ Rails.application.config.assets.paths << Rails.root.join('node_modules')
|
||||
# application.js, application.css, and all non-JS/CSS in the app/assets
|
||||
# folder are already added.
|
||||
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
||||
|
||||
# Workaround for Segfault
|
||||
# https://github.com/sass/sassc-ruby/issues/197
|
||||
Rails.application.config.assets.configure do |env|
|
||||
env.export_concurrent = false
|
||||
end
|
||||
@@ -143,7 +143,7 @@ Devise.setup do |config|
|
||||
# without confirming their account.
|
||||
# Default is 0.days, meaning the user cannot access the website without
|
||||
# confirming their account.
|
||||
# config.allow_unconfirmed_access_for = 2.days
|
||||
config.allow_unconfirmed_access_for = 2.days
|
||||
|
||||
# A period that the user is allowed to confirm their account before their
|
||||
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
||||
@@ -151,7 +151,7 @@ Devise.setup do |config|
|
||||
# their account can't be confirmed with the token any more.
|
||||
# Default is nil, meaning there is no restriction on how long a user can take
|
||||
# before confirming their account.
|
||||
# config.confirm_within = 3.days
|
||||
config.confirm_within = 3.days
|
||||
|
||||
# If true, requires any email changes to be confirmed (exactly the same way as
|
||||
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
||||
@@ -164,7 +164,7 @@ Devise.setup do |config|
|
||||
|
||||
# ==> Configuration for :rememberable
|
||||
# The time the user will be remembered without asking for credentials again.
|
||||
# config.remember_for = 2.weeks
|
||||
config.remember_for = 8.weeks
|
||||
|
||||
# Invalidates all the remember me tokens when the user signs out.
|
||||
config.expire_all_remember_me_on_sign_out = true
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
Rails.application.routes.draw do
|
||||
get 'pages/home'
|
||||
mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
|
||||
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
|
||||
|
||||
devise_for :admins
|
||||
root to: "pages#home"
|
||||
end
|
||||
|
||||
@@ -15,22 +15,22 @@ class DeviseCreateAdmins < ActiveRecord::Migration[6.0]
|
||||
t.datetime :remember_created_at
|
||||
|
||||
## Trackable
|
||||
# t.integer :sign_in_count, default: 0, null: false
|
||||
# t.datetime :current_sign_in_at
|
||||
# t.datetime :last_sign_in_at
|
||||
# t.inet :current_sign_in_ip
|
||||
# t.inet :last_sign_in_ip
|
||||
t.integer :sign_in_count, default: 0, null: false
|
||||
t.datetime :current_sign_in_at
|
||||
t.datetime :last_sign_in_at
|
||||
t.inet :current_sign_in_ip
|
||||
t.inet :last_sign_in_ip
|
||||
|
||||
## Confirmable
|
||||
# t.string :confirmation_token
|
||||
# t.datetime :confirmed_at
|
||||
# t.datetime :confirmation_sent_at
|
||||
# t.string :unconfirmed_email # Only if using reconfirmable
|
||||
t.string :confirmation_token
|
||||
t.datetime :confirmed_at
|
||||
t.datetime :confirmation_sent_at
|
||||
t.string :unconfirmed_email # Only if using reconfirmable
|
||||
|
||||
## Lockable
|
||||
# t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
||||
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||
# t.datetime :locked_at
|
||||
t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
|
||||
t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||
t.datetime :locked_at
|
||||
|
||||
|
||||
t.timestamps null: false
|
||||
@@ -38,7 +38,7 @@ class DeviseCreateAdmins < ActiveRecord::Migration[6.0]
|
||||
|
||||
add_index :admins, :email, unique: true
|
||||
add_index :admins, :reset_password_token, unique: true
|
||||
# add_index :admins, :confirmation_token, unique: true
|
||||
# add_index :admins, :unlock_token, unique: true
|
||||
add_index :admins, :confirmation_token, unique: true
|
||||
add_index :admins, :unlock_token, unique: true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
#
|
||||
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
|
||||
# Character.create(name: 'Luke', movie: movies.first)
|
||||
admin = Admin.create([{email: 'admin@example.org', password: 'password'}])
|
||||
@@ -6,6 +6,7 @@
|
||||
"@rails/activestorage": "^6.0.0",
|
||||
"@rails/ujs": "^6.0.0",
|
||||
"@rails/webpacker": "4.3.0",
|
||||
"toastr": "^2.1.4",
|
||||
"turbolinks": "^5.2.0"
|
||||
},
|
||||
"version": "0.1.0",
|
||||
|
||||
@@ -1,9 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="RUBY_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="RailsFacetType" name="Ruby on Rails">
|
||||
<configuration>
|
||||
<RAILS_FACET_CONFIG_ID NAME="RAILS_FACET_SUPPORT_REMOVED" VALUE="false" />
|
||||
<RAILS_FACET_CONFIG_ID NAME="RAILS_TESTS_SOURCES_PATCHED" VALUE="true" />
|
||||
<RAILS_FACET_CONFIG_ID NAME="RAILS_FACET_APPLICATION_ROOT" VALUE="$MODULE_DIR$" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.bundle" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/components" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/log" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/public/packs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/public/system" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/bundle" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/cache" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="RModuleSettingsStorage">
|
||||
<LOAD_PATH number="0" />
|
||||
<I18N_FOLDERS number="1" string0="$MODULE_DIR$/config/locales" />
|
||||
</component>
|
||||
</module>
|
||||
9
test/controllers/pages_controller_test.rb
Normal file
9
test/controllers/pages_controller_test.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
require 'test_helper'
|
||||
|
||||
class PagesControllerTest < ActionDispatch::IntegrationTest
|
||||
test "should get home" do
|
||||
get pages_home_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
end
|
||||
24
yarn.lock
24
yarn.lock
@@ -1788,9 +1788,9 @@ caniuse-api@^3.0.0:
|
||||
lodash.uniq "^4.5.0"
|
||||
|
||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001111:
|
||||
version "1.0.30001114"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001114.tgz#2e88119afb332ead5eaa330e332e951b1c4bfea9"
|
||||
integrity sha512-ml/zTsfNBM+T1+mjglWRPgVsu2L76GAaADKX5f4t0pbhttEp0WMawJsHDYlFkVZkoA+89uvBRrVrEE4oqenzXQ==
|
||||
version "1.0.30001115"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001115.tgz#c04cd828883ba47f6f776312e0817bcc9040cfa4"
|
||||
integrity sha512-NZrG0439ePYna44lJX8evHX2L7Z3/z3qjVLnHgbBb/duNEnGo348u+BQS5o4HTWcrb++100dHFrU36IesIrC1Q==
|
||||
|
||||
case-sensitive-paths-webpack-plugin@^2.2.0:
|
||||
version "2.3.0"
|
||||
@@ -2635,9 +2635,9 @@ ee-first@1.1.1:
|
||||
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
|
||||
|
||||
electron-to-chromium@^1.3.523:
|
||||
version "1.3.533"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.533.tgz#d7e5ca4d57e9bc99af87efbe13e7be5dde729b0f"
|
||||
integrity sha512-YqAL+NXOzjBnpY+dcOKDlZybJDCOzgsq4koW3fvyty/ldTmsb4QazZpOWmVvZ2m0t5jbBf7L0lIGU3BUipwG+A==
|
||||
version "1.3.534"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.534.tgz#fc7af8518dd00a5b22a24aed3f116b5d097e2330"
|
||||
integrity sha512-7x2S3yUrspNHQOoPk+Eo+iHViSiJiEGPI6BpmLy1eT2KRNGCkBt/NUYqjfXLd1DpDCQp7n3+LfA1RkbG+LqTZQ==
|
||||
|
||||
elliptic@^6.5.3:
|
||||
version "6.5.3"
|
||||
@@ -3991,6 +3991,11 @@ jest-worker@^25.4.0:
|
||||
merge-stream "^2.0.0"
|
||||
supports-color "^7.0.0"
|
||||
|
||||
jquery@>=1.12.0:
|
||||
version "3.5.1"
|
||||
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.1.tgz#d7b4d08e1bfdb86ad2f1a3d039ea17304717abb5"
|
||||
integrity sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==
|
||||
|
||||
js-base64@^2.1.8:
|
||||
version "2.6.4"
|
||||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4"
|
||||
@@ -7058,6 +7063,13 @@ to-regex@^3.0.1, to-regex@^3.0.2:
|
||||
regex-not "^1.0.2"
|
||||
safe-regex "^1.1.0"
|
||||
|
||||
toastr@^2.1.4:
|
||||
version "2.1.4"
|
||||
resolved "https://registry.yarnpkg.com/toastr/-/toastr-2.1.4.tgz#8b43be64fb9d0c414871446f2db8e8ca4e95f181"
|
||||
integrity sha1-i0O+ZPudDEFIcURvLbjoyk6V8YE=
|
||||
dependencies:
|
||||
jquery ">=1.12.0"
|
||||
|
||||
toidentifier@1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"
|
||||
|
||||
Reference in New Issue
Block a user