Skip to content

Instantly share code, notes, and snippets.

Created June 18, 2013 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5807012 to your computer and use it in GitHub Desktop.
Save anonymous/5807012 to your computer and use it in GitHub Desktop.
##### ERROR
undefined method `question_path' for #<#<Class:0x007fa183901da8>:0x007fa1838e2ca0>
##### VIEW
<% @questions.each do |question| %>
<tr>
<td><a href="/surveys/<%= @survey.id %>/questions/<%= question.id %>/"><%= question.question %></td>
<td><%= question.qtype %></td>
<td>
<!-- Deleting this gets rid of the error. -->
<%= link_to 'Delete', question, :confirm => 'Are you Sure?', :method => :delete %>
</td>
</tr>
<% end %>
##### CONTROLLER
def show
@survey = Survey.find(params[:id])
@questions = @survey.questions
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @survey }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment