11/14 innovation cloud


#1

Hello,

My code:

class SignupsController < ApplicationController
def new @signup = Signup.new
end
end

The error is:

/home/ccuser/workspace/learn-rails_innovation-cloud/innovation-cloud/app/controllers/signups_controller.rb:2: formal argument cannot be an instance variable def new @signup = Signup.new ^ /home/ccuser/workspace/learn-rails_innovation-cloud/innovation-cloud/app/controllers/signups_controller.rb:2: syntax error, unexpected '=', expecting ';' or '\n' def new @signup = Signup.new ^ /home/ccuser/workspace/learn-rails_innovation-cloud/innovation-cloud/app/controllers/signups_controller.rb:4: syntax error, unexpected keyword_end, expecting end-of-input

Rails.root: /home/ccuser/workspace/learn-rails_innovation-cloud/innovation-cloud

Thanks


#2

Hi David,

Put your code for the new action on it's own line. Like this:

def my_function
  # ...
end

rather than this:

def my_function # ...
end

:slight_smile:


#3

Awesome thank you sir.


#4

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.