error in Action Controller

1

I get it:

  

error undefined method '&' for "application": String

I'm trying to do this method

def registro
    _layout 'application'
    @usuario = Usuarios.new
  end
end

is a forms for user registration

thanks !!

    
asked by Camilo Andres Quiroga 08.08.2018 в 19:47
source

1 answer

0

I see a couple of errors, first that the command is layout and not _layout , the second is that or you should use them outside the context of the action:

layout 'application'

def registro
  @usuario = Usuarios.new
end

or as a parameter of a render:

def registro
  @usuario = Usuarios.new
  render layout: 'application'
end

Finally, the layout of application is the one that comes by default, so it is not necessary to call layout. More information on the rails documentation .

    
answered by 09.08.2018 / 17:58
source