skip to Main Content

I have the template in my views/layout folder still it is showing missing template.Also twitter bootstrap not working

Missing partial layouts/_user_header with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. Searched in:
  * "/home/techbirds/shivam/app/views"
  * "/home/techbirds/.rvm/gems/ruby-2.2.1/gems/devise-3.5.2/app/views"

(application.html.erb)

<!DOCTYPE html>
<html>
<head>
  <title>Shivam</title>
  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>
</head>
<body>
<% flash.each do |key, value| %>
    <div class="alert alert-<%= key %> alert-dismissable">

        <%= value %>
    </div>
<% end %>
<div class="container-narrow">
  <div class="masthead">
    <%= render 'layouts/user_header' %>
    <h3 class="muted"><%= link_to "SimpleDevise", root_path %></h3>
    <h5 class="muted">A demo of using SimpleDB with Devise</h5>
  </div>
  <hr />
  <%= yield %>
</div>

<% if user_signed_in? %>

  <%= link_to('Logout', destroy_user_session_path, :method => :delete) %>        

<% else %>

  <%= link_to('Login', new_user_session_path)  %>  

<% end %>
<%= yield %>

</body>
</html>

I have added this line //= require twitter/bootstrap in my (application.js)
I have added this line *= require twitter/bootstrap in my (application.css)

3

Answers


  1. UPDATE

    application.html.erb

    <%= render partial: 'layouts/user_header' %>
    

    Add the partial in views

    views/layouts/_user_header.html.erb

    # erb content goes here
    
    Login or Signup to reply.
  2. please keep the views/layouts folder clean. you can put your partials in the folder views/application.

    if you do it like that, you can do it like this:

     `<%= render 'user_header' %>`
    
    Login or Signup to reply.
  3. you should review again partial instead bootstrap. Because error message is applyed for partial not bootstrap.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search