小编Joa*_*dyn的帖子

Rails / Webpack:TinyMCE 无法加载皮肤(404(未找到))

I am working on a Rails project that has been using assets pipeline but we are currently trying to transition to webpack. I encountered a problem when attempting to get TinyMCE to work after pulling it through yarn - the text editor simply won't load.

Before the transition to webpack

Originally I used a CDN in the application.html.haml and things were working fine:

%script{src: 'https://cloud.tinymce.com/stable/tinymce.min.js?apiKey=gexncjni90zx3qf0m5rr7kl8l40wd5yuly2xjza0g3kwrljt'}`
Run Code Online (Sandbox Code Playgroud)

After the transition

I installed the package through yarn: $ yarn add tinymce

I also …

tinymce ruby-on-rails npm webpack

7
推荐指数
1
解决办法
2219
查看次数

设计:可锁定-last_attempt_warning不显示

我试图:lockable按照此Wiki实现我设计的模块,但遇到了一些问题。在开发中,当maximum_attempts多次尝试登录时,该failed_attempts属性会正确更新,并且用户帐户将被锁定,但是:

1)尽管config.last_attempt_warning = true没有显示警告消息

2)我收到一封unlock_instructions电子邮件,但是当我将链接复制粘贴到浏览器中时,出现invalid authorisation token错误。

config / initializers / devise.rb

# ==> Configuration for :lockable
config.lock_strategy = :failed_attempts
config.unlock_keys = [:email]
config.unlock_strategy = :email
config.maximum_attempts = 3
config.last_attempt_warning = true
Run Code Online (Sandbox Code Playgroud)

型号/user.rb

class User < ApplicationRecord
  devise :database_authenticatable, :confirmable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable, :lockable
end
Run Code Online (Sandbox Code Playgroud)

视图/设计/会话/新

= flash[:alert] if flash[:alert]
= flash[:notice] if flash[:notice]

= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
  .form-inputs
    = …
Run Code Online (Sandbox Code Playgroud)

ruby error-handling ruby-on-rails devise

4
推荐指数
1
解决办法
401
查看次数

Rails:使用em空间连接数组

是否可以在RoR中使用em空间加入数组?

IRB:

a = ["a", "b", "c"]
#=> ["a", "b", "c"]

a.join('    ')
#=> "a    b    c"

a.join('&#8195;')
#=> "a&#8195;b&#8195;c"

a.join('&#x2003;')
#=> "a&#x2003;b&#x2003;c"

a.join('&emsp;')
#=> "a&emsp;b&emsp;c"
Run Code Online (Sandbox Code Playgroud)

但是由浏览器呈现,a.join('&emsp;')仍然会吐出来a&emsp;b.

ruby arrays ruby-on-rails

1
推荐指数
1
解决办法
77
查看次数

标签 统计

ruby-on-rails ×3

ruby ×2

arrays ×1

devise ×1

error-handling ×1

npm ×1

tinymce ×1

webpack ×1