简体   繁体   English

Bootstrap Sass打破了设计

[英]Bootstrap Sass broke devise

Hi I hope someone can help. 嗨,我希望有人能提供帮助。 I i'm building a news application on rails. 我在Rails上构建新闻应用程序。 I installed devise and act-as-votable for posts. 我为帖子安装了devise和as-vovoable。 I then installed bootstrap-sass (twbs/bootstrap-sass) and devise wont render to the screen. 然后,我安装了bootstrap-sass(twbs / bootstrap-sass),并设计了不会渲染到屏幕上的东西。

<% if user_signed_in? %>       
    <div class="index_log">
      Hey, your logged in as <strong><%= current_user.email %></strong>.
  <% if user_signed_in? %>     
        <%= button_to "Log Out", destroy_user_session_path, method: :delete, class: 'btn btn-default navbar-btn' %>
  <% else %>
    <%= link_to "Log In", new_user_session_path, class: 'btn btn-default navbar-btn', method: :get %>
  <% end %>

When I go go to the login page, enter my username and password, nothing happens. 当我转到登录页面时,输入我的用户名和密码,什么都没有发生。 Or else I create a new user, again nothing happens. 否则,我将创建一个新用户,再次没有任何反应。 Any Ideas - I would add code below but I'm not sure what to add. 任何想法-我将在下面添加代码,但不确定添加什么。

Looks like you have an extra if user_signed_in? if user_signed_in?您使用if user_signed_in?您似乎还有多余的if user_signed_in? tag 标签

Hey, your logged in as <strong><%= current_user.email %></strong>.
<% if user_signed_in? %>

and that is messing up your <% else %> (which now matches the extra if and is now nested within the first if user_signed_in? and will never be rendered. 这会弄乱您的<% else %> (现在与多余的if和现在匹配,嵌套在第一个if user_signed_in?并且永远不会呈现。

Also, unrelated, but it should be "...you're logged in as..." and the div class="index_log" isn't closed 另外,不相关,但应为“ ...您以...身份登录”,并且div class="index_log"未关闭

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

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