fix user feedback controller test
This commit is contained in:
6
app/views/user_feedbacks/_secondary_links.html.erb
Normal file
6
app/views/user_feedbacks/_secondary_links.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<% content_for(:secondary_links) do %>
|
||||
<menu>
|
||||
<li><%= link_to "New", new_user_feedback_path %></li>
|
||||
<li><%= link_to "Listing", user_feedbacks_path %></li>
|
||||
</menu>
|
||||
<% end %>
|
||||
0
app/views/user_feedbacks/edit.html.erb
Normal file
0
app/views/user_feedbacks/edit.html.erb
Normal file
32
app/views/user_feedbacks/index.html.erb
Normal file
32
app/views/user_feedbacks/index.html.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<div id="c-user-feedbacks">
|
||||
<div id="a-index">
|
||||
<h1>User Feedback</h1>
|
||||
|
||||
<table width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="15%">User</th>
|
||||
<th width="15%">Creator</th>
|
||||
<th width="15%">When</th>
|
||||
<th width="55%">Message</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @user_feedbacks.each do |feedback| %>
|
||||
<tr>
|
||||
<td><%= link_to feedback.user_name, user_feedback_path(feedback.user_id) %></td>
|
||||
<td><%= feedback.creator.name %></td>
|
||||
<td><%= time_ago_in_words(feedback.created_at) %> ago</td>
|
||||
<td><%= format_text(feedback.body) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="paginator">
|
||||
<%= numbered_paginator(@user_feedbacks) %>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
</div>
|
||||
</div>
|
||||
17
app/views/user_feedbacks/new.html.erb
Normal file
17
app/views/user_feedbacks/new.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<div id="c-user-feedbacks">
|
||||
<div id="a-new">
|
||||
<h1>New User Feedback</h1>
|
||||
|
||||
<div id="preview">
|
||||
</div>
|
||||
|
||||
<%= simple_form_for(@user_feedback) do |f| %>
|
||||
<%= f.input :user_name %>
|
||||
<%= f.input :category, :collection => ["positive", "neutral", "negative"] %>
|
||||
<%= f.input :body %>
|
||||
<%= f.button :submit %>
|
||||
<%= f.button :submit, :value => "Preview" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
14
app/views/user_feedbacks/show.html.erb
Normal file
14
app/views/user_feedbacks/show.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<div id="c-user-feedbacks">
|
||||
<div id="a-show">
|
||||
<h1>User Feedback For <%= @user_feedback.user_name %></h1>
|
||||
|
||||
<ul>
|
||||
<li><strong>Creator</strong> <%= @user_feedback.creator.name %></li>
|
||||
<li><strong>Date</strong> <%= @user_feedback.created_at %></li>
|
||||
<li><strong>Category</strong> <%= @user_feedback.category %></li>
|
||||
<li><strong>Message</strong> <%= format_text @user_feedback.body %></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
Reference in New Issue
Block a user