Skip to content

Instantly share code, notes, and snippets.

@cherring
Forked from dalizard/comments_controller.rb
Created December 8, 2010 13:12
Show Gist options
  • Save cherring/733264 to your computer and use it in GitHub Desktop.
Save cherring/733264 to your computer and use it in GitHub Desktop.
.input
= f.text_area :body
= f.hidden_field :commented_by, :value => current_user.email
def create
@comment = @issue.comments.build(params[:comment])
if @comment.save
redirect_to project_issue_path(@issue.project, @issue)
else
render :new
end
end
- content_for(:heading) do
= @project.name
#inner
%h2= "Comment on #{@issue.name}"
= form_for [:project, :issue, @comment] do |f|
= render :partial => "form", :locals => { :f => f, :comment => @comment }
.input
= f.submit "Add Comment", :class => "blue-button medium"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment