Skip to content

Instantly share code, notes, and snippets.

@richardsondx
Created July 19, 2011 19:40
Show Gist options
  • Save richardsondx/1093513 to your computer and use it in GitHub Desktop.
Save richardsondx/1093513 to your computer and use it in GitHub Desktop.
Issue with the edit part of the associated post.
def create
@micropost = Micropost.find(params[:micropost_id])
@answer = @micropost.answers.create(params[:answer])
redirect_to micropost_path(@micropost)
end
def edit
@micropost = Micropost.find(params[:micropost_id])
@answer = @micropost.answer.find(params[:id])
end
-----
and my show view is:
<% @micropost.answers.each do |answer| %>
<p>
<b>Answer:</b>
<%= answer.location%> <%= link_to 'Edit', edit_answer_path(@micropost, @answer) %>
</p>
<%end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment