vendredi 27 février 2015

http://localhost:3000/users/new Routing Error

Im following this tutorial. http://ift.tt/1kmdoqc i just the part titled Adding Some Validations to the User Model


When i go to http://localhost:3000/users/new i get an routing error. But based on my knowledge the rout looks fine. Whats wrong?


user_controller.rb



class UsersController < ApplicationController
def new
@user = User.new
end
def create
@user = User.new(params[:user])
if @user.save
flash[:notice] = "You signed up successfully"
flash[:color]= "valid"
else
flash[:notice] = "Form is invalid"
flash[:color]= "invalid"
end
render "new"
end
end


routes.rb



Rails.application.routes.draw do
get 'users/new'

Aucun commentaire:

Enregistrer un commentaire