First working version with devise+rails_admin

This commit is contained in:
2020-08-19 07:31:31 +01:00
parent 8eadda6a48
commit 1bc17c462a
21 changed files with 230 additions and 38 deletions
+3
View 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
View File
@@ -0,0 +1,4 @@
class PagesController < ApplicationController
def home
end
end
+2
View File
@@ -0,0 +1,2 @@
module PagesHelper
end
+2 -1
View File
@@ -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' %>)
@@ -0,0 +1 @@
@import 'toastr'
+2 -1
View File
@@ -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
+8
View File
@@ -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
View File
@@ -0,0 +1,2 @@
<h1>Pages#home</h1>
<p>Find me in app/views/pages/home.html.erb</p>