Created
July 19, 2011 19:40
-
-
Save richardsondx/1093513 to your computer and use it in GitHub Desktop.
Issue with the edit part of the associated post.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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