Skip to content

Instantly share code, notes, and snippets.

@smooki
Created November 24, 2011 16:11
Show Gist options
  • Save smooki/1391704 to your computer and use it in GitHub Desktop.
Save smooki/1391704 to your computer and use it in GitHub Desktop.
The action 'add_comment' could not be found for KittiesController ....
class KittiesController < ApplicationController
helper :comment
...
end
module CommentHelper
def add_comment
new_comment = Comment.build_from(slef, current_user.id, params[:body])
new_comment.save!
redirect_to event_kitty_path(params[:event_id], self)
end
end
<% form_tag add_comment_event_kitty_url(@event, @kitty), :method => :post do %>
<%= text_area_tag :body %>
<div class="submit">
<%= submit_tag t(:post_comment) %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment