First working version with devise+rails_admin
This commit is contained in:
@@ -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/
|
||||
@@ -0,0 +1,4 @@
|
||||
class PagesController < ApplicationController
|
||||
def home
|
||||
end
|
||||
end
|
||||
@@ -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' %>)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
@import 'toastr'
|
||||
+2
-1
@@ -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 %>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1>Pages#home</h1>
|
||||
<p>Find me in app/views/pages/home.html.erb</p>
|
||||
Reference in New Issue
Block a user