This is my code in the view, just calling to the edit proposal path
<%= link_to "Edit this Proposal", edit_idea_proposal_path %>
This is my code in the Proposals Controller. I clearly have an “Edit” action, so why is it giving me a route error for Edit?
def create
@idea = Idea.find(params[:idea_id])
@proposal = @idea.proposals.create(params[:proposal])
if @proposal.save
flash[:success] = "Thanks for the Proposal!"
redirect_to idea_proposals_url(@idea)
else
render 'new'
end
end
def edit
@idea = Idea.find(params[:idea_id])
@proposal = @idea.proposals.find(params[:id])
end
def update
@idea = Idea.find(params[:idea_id])
@proposal = @idea.proposals.find(params[:id])
if @proposal.update_attributes(params[:proposal])
redirect_to idea_proposals_url(@idea)
else
render 'edit'
end
end
Figured it out, I needed to change the code in my view from:
To: