简体   繁体   English

Rails Bootstrap打破了Devise

[英]Rails Bootstrap broke Devise

Im building a rails news app, Im using Devise for authentication. 我正在构建一个Rails新闻应用程序,我使用Devise进行身份验证。 - I just installed twitter bootstrap - (twbs/bootstrrap-sass) Now when I try and login in or create a new user nothing happens. -我刚刚安装了twitter bootstrap-(twbs / bootstrrap-sass)现在,当我尝试登录或创建新用户时,什么也没有发生。 Here is a copy of my log. 这是我的日志的副本。 Any suggestions? 有什么建议么?

    Started GET "/users/sign_in?
utf8=%E2%9C%93&authenticity_token=aVBlvsx4myc%2BP91qvVF4OENxrq5RMMtXqZyZD%2Bk3USROHJxoQ5LHfiuRwUGKzypB178miOD5pcrUpXOwkDeAYg%3D%3D&user%5Bemail%5D=david%40email.com&user%5Bpassword%5D=[FILTERED]&user%5Bremember_me%5D=0&commit=Log+in" for 10.240.1.18 at 2017-07-19 11:56:18 +0000
Cannot render console from 10.240.1.18! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by Devise::SessionsController#new as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"aVBlvsx4myc+P91qvVF4OENxrq5RMMtXqZyZD+k3USROHJxoQ5LHfiuRwUGKzypB178miOD5pcrUpXOwkDeAYg==", "user"=>{"email"=>"david@email.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Log in"}
  Rendering devise/sessions/new.html.erb within layouts/application
  Rendered devise/shared/_links.html.erb (1.2ms)
  Rendered devise/sessions/new.html.erb within layouts/application (5.5ms)
  Rendered partials/_jumbotron.html.erb (0.7ms)
Completed 200 OK in 325ms (Views: 74.3ms | ActiveRecord: 0.0ms)

Here is my application.rb 这是我的application.rb

require_relative 'boot'

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Newsroom
    class Application < Rails::Application
[x] config.web_console.whitelisted_ips = '10.240.1.18"

    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 5.1

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    end
  end
end

Here is a log for a different app that is working: 这是正在运行的其他应用程序的日志:

Started GET "/" for 10.240.1.4 at 2017-07-19 12:35:47 +0000
Cannot render console from 10.240.1.4! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by SiteController#home as HTML
  Rendering site/home.html.erb within layouts/application
  Rendered site/home.html.erb within layouts/application (0.4ms)
  User Load (0.3ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ?  [["id", 2], ["LIMIT", 1]]
Completed 200 OK in 30ms (Views: 28.9ms | ActiveRecord: 0.3ms)

for some reason when I try and sign up on my new app its not running any sql 由于某些原因,当我尝试在新应用程序上注册时,它未运行任何sql

you need to whitelist that ip in application.rb or in config/environments/development.rb 您需要在application.rb或config / environments / development.rb中将该IP白名单

class Application < Rails::Application
  config.web_console.whitelisted_ips = "10.240.1.18"
end

this document might help https://github.com/rails/web-console#configweb_consolewhitelisted_ips 本文档可能会有所帮助https://github.com/rails/web-console#configweb_consolewhitelisted_ips

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM