Codecademy Forums

Innovation Cloud - Step 14 - Receiving Error "The action 'index' could not be found for SignupsController"

Hi CC Team! I have been working through the “Innovation Cloud” project and receive the error " The action ‘index’ could not be found for SignupsController" every time I try to submit a test email address.

As you can see, the page visits /signups instead of /thanks as instructed in my code. Also, the project does not instruct me to create an index action OR view. Can you please advise?

Link to project: https://www.codecademy.com/courses/learn-rails/projects/learn-rails_innovation-cloud

Link to full question with images (Forum won’t let me post more than 1 image) : https://docs.google.com/document/d/1FSPcPg5zme2WX9dIGwUBKnvFOYMDhGm8pXwGnh-vFqk/edit?usp=sharing

Thank you in advance!

Hi @eternallearner_5,

That error means that Rails is looking for a function called index in signups_controller.rb. To fix it, you need to create the index function so that Rails can use it to display the view:

def index
end

Usually you’ll add more inside the function, maybe something like @signups = Signup.all in the body of the function, but all Rails is looking for in this case is an index function, empty or not.

Let me know if you’re still having problems after fixing that :slight_smile:

Hi @zystvan,

Thanks for helping out here. Based on the project, it doesn’t look like I should have an ‘index’ function. The problem that I’m having is that a GET request is occurring when the form is submitted (which ties to the Index controller action) instead of a POST request (which ties to the Create controller action). How can I change my code so that it runs a POST request instead of a GET request? I followed all of the steps correctly.

Thank you.