Skip to content

Instantly share code, notes, and snippets.

@Jeraimee
Created July 9, 2009 04:23
Show Gist options
  • Save Jeraimee/143426 to your computer and use it in GitHub Desktop.
Save Jeraimee/143426 to your computer and use it in GitHub Desktop.
# Partial for 'new comment' derived from http://railscasts.com/episodes/154-polymorphic-association
#
<% form_for [@commentable, Comment.new] do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :content %><br />
<%= f.text_area :content %>
</p>
<p><%= f.submit "Submit" %></p>
<% end %>
# Error is: undefined method `comments_path' for #<ActionView::Base:0x2332ec4>
# routes.rb contains (for each model that has comments):
#
map.resources :cities, :has_many => :comments
# and still the default:
#
map.connect ':controller/:action/:id'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment