html - Ruby on Rails- Model Views Somehow Become Part of Navigation Bar -



html - Ruby on Rails- Model Views Somehow Become Part of Navigation Bar -

i new ror. in app, have a model called clubs , navigation bar on top. however, every view of clubs becomes part of navigation bar reason when app rendered. here's screenshot show mean:

this code have:

<html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>bhsclubs</title> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> </head> <body> <div class="navbar navbar-fixed-top"> <!-- brand , toggle grouped improve mobile display --> <div class="navbar-inner"> <div class="container"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">brookline high school</a> <!-- collect nav links, forms, , other content toggling --> <ul class="nav navbar-nav"> <li> <a href="#">about</a> </li> <li> <a href="#">services</a> </li> <li> <a href="#">contact</a> </li> <ul class="navbar-text pull-right"> <% if user_signed_in? %> logged in <strong><%= current_user.email %></strong>. <%= link_to 'edit profile', edit_user_registration_path, :class => 'navbar-link' %> | <%= link_to "logout", destroy_user_session_path, method: :delete, :class => 'navbar-link' %> <% else %> <%= link_to "sign up", new_user_registration_path, :class => 'navbar-link' %> | <%= link_to "login", new_user_session_path, :class => 'navbar-link' %> <% end %> <% if notice %> <p class="alert alert-success"> <%= notice %> </p> <% end %> <% if alert %> <p class="alert alert-danger"> <%= alert %> </p> <% end %> <%= yield %> </ul> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container --> </div> </body> </html>

show method

<div class="container"> <div class="row"> <div class="col-md-3"> <p class="lead"> <%= @club.name %> </p> <div class="list-group"> <a href="#" class="list-group-item active">information</a> <a href="#" class="list-group-item">announcements</a> </div> </div> <div class="col-md-9"> <div class="thumbnail"> <img class="img-responsive" src="http://placehold.it/800x300" alt=""> <div class="caption-full"> <p id="notice"> <%= notice %> </p> <p> <h4>name:</h4> <%= @club.name %> </p> <p> <strong>description:</strong> <%= @club.description %> </p> <p> <strong>location:</strong> <%= @club.location %> </p> <p> <strong>picture:</strong> <%= image_tag(@club.picture_url, :width => 600) if @club.picture.present? %> </p> <%= link_to 'edit', edit_club_path(@club) %> | <%= link_to 'back', clubs_path %> </div> </div> </div> </div>

any help appreciated.

you're rendering clubs <%= yield %> within application navigation bar!, have set <%= yield %> outside navigation element, within bootstrap .container element.

<html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>bhsclubs</title> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> </head> <body> <div class="navbar navbar-fixed-top"> <!-- brand , toggle grouped improve mobile display --> <div class="navbar-inner"> <div class="container"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">brookline high school</a> <!-- collect nav links, forms, , other content toggling --> <ul class="nav navbar-nav"> <li> <a href="#">about</a> </li> <li> <a href="#">services</a> </li> <li> <a href="#">contact</a> </li> <ul class="navbar-text pull-right"> <% if user_signed_in? %> logged in <strong><%= current_user.email %></strong>. <%= link_to 'edit profile', edit_user_registration_path, :class => 'navbar-link' %> | <%= link_to "logout", destroy_user_session_path, method: :delete, :class => 'navbar-link' %> <% else %> <%= link_to "sign up", new_user_registration_path, :class => 'navbar-link' %> | <%= link_to "login", new_user_session_path, :class => 'navbar-link' %> <% end %> <% if notice %> <p class="alert alert-success"> <%= notice %> </p> <% end %> <% if alert %> <p class="alert alert-danger"> <%= alert %> </p> <% end %> </ul> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container --> </div> <div class="container"> <div class="row"> <div class="col-sm-12"> <%= yield %> </div> </div> </div> </body> </html>

html css ruby-on-rails twitter-bootstrap layout

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -