Skip to content

Instantly share code, notes, and snippets.

@marcamillion
Created September 5, 2011 08:24
Show Gist options
  • Save marcamillion/1194424 to your computer and use it in GitHub Desktop.
Save marcamillion/1194424 to your computer and use it in GitHub Desktop.
<%= form_for(@feedback) do |f| %>
<% if @feedback.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@feedback.errors.count, "error") %> prohibited this feedback from being saved:</h2>
<ul>
<% @feedback.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :poster_id %><br />
<%= f.number_field :poster_id %>
</div>
<div class="field">
<%= f.label :receiver_id %><br />
<%= f.number_field :receiver_id %>
</div>
<div class="field">
<%= f.label :content %><br />
<%= f.text_field :content %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
ActionView::Template::Error (undefined method `feedback_feedback_path' for #<#<Class:0x00000103068458>:0x00000103054250>):
1: <%= form_for(@feedback) do |f| %>
2: <% if @feedback.errors.any? %>
3: <div id="error_explanation">
4: <h2><%= pluralize(@feedback.errors.count, "error") %> prohibited this feedback from being saved:</h2>
app/views/feedbacks/_form.html.erb:1:in `_app_views_feedbacks__form_html_erb___2039037845826485746_2173882680'
app/views/home/index.html.erb:17:in `_app_views_home_index_html_erb__2518153290388327788_2175341580'
<h1>Feedback Posted</h1>
<% @users.each do |user| %>
<% user.feedbacks_as_poster.each do |feedback| %>
<%= "#{user.f_name.capitalize}" + " " + "#{user.l_name}" + " aka '" + "#{user.username}'" %> has POSTED "<%= link_to "#{feedback.content}", feedbacks_path(feedback) %>" for '<%= feedback.receiver.username %>'<br />
<% end %>
<% end %>
<h1>Feedback Received</h1>
<% @users.each do |user| %>
<% user.feedbacks_as_receiver.each do |feedback| %>
<%= "#{user.f_name.capitalize}" + " " + "#{user.l_name}" + " aka '" + "#{user.username}'" %> has RECEIVED "<%= link_to "#{feedback.content}", feedbacks_path(feedback) %>" for '<%= feedback.poster.username %>'<br />
<% end %>
<% end %>
<% render "feedbacks/form" %>
NoMethodError in Home#index
Showing /app/views/feedbacks/_form.html.erb where line #1 raised:
undefined method `model_name' for NilClass:Class
MyApp::Application.routes.draw do
get "home/index"
resources :roles
resources :feedbacks
resources :assignments
resources :users
root :to => 'home#index'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment