mardi 18 août 2015

Difficulty Rendering Partial from another View

I am having trouble rendering a partial on Rails 4.2.1 There are no errors in the Rails Server logs and no output in the view. I have removed the as: option and the result is the same. Even if I hardcode the partial, the view does not display the information and the server log shows no errors.

app/views/registry_requests/_index.html.erb

<p><%= request.vehicle.make %></p>

app/views/users/_admin.html.erb

<!-- Columns -->
<div class="row">
  <!-- Dashboard -->
  <%= render 'admin_panel' %>

  <!-- Body Content -->
  ...

    <!-- Widgets -->
    ...
          <%= render partial: "registry_requests/index", collection: @registry_requests, as: :request %>

        ...
      <!-- Blog Feed -->
      <div class="col-sm-6">
        <div class="admin-widget">
          <h1 class="widget">Recent Blog Posts</h1>
          ...
        </div>
        <a class="admin-widget-link" href="blog_create.html">Create Post</a>
      </div>
      <!-- Current Moderators -->
      <div class="col-sm-6">
        <div class="admin-widget">
          <h1 class="widget">Current Moderators</h1>
          ....
        </div>
        <a class="admin-widget-link" href="#">Manage Moderators</a>
      </div>
    </div>
  </div>
</div>

logs

Started GET "/users/6" for ::1 at 2015-08-18 12:35:30 -0400
Processing by UsersController#show as HTML
  Parameters: {"id"=>"6"}
  User Load (0.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ?  ORDER BY "users"."id" ASC LIMIT 1  [["id", 6]]
  User Load (0.1ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1  [["id", 6]]
  Rendered users/_admin_panel.html.erb (0.4ms)
  Rendered registry_requests/_index.html.erb (0.0ms)
  Rendered users/_admin.html.erb (3.8ms)
  Rendered users/show.html.erb within layouts/application (5.8ms)
Completed 200 OK in 117ms (Views: 113.7ms | ActiveRecord: 0.2ms)

Aucun commentaire:

Enregistrer un commentaire