Skip to content
This repository was archived by the owner on Jul 7, 2021. It is now read-only.
This repository was archived by the owner on Jul 7, 2021. It is now read-only.

No route matches {:action=>"show", :controller=>"user_steps", :id=>nil} error when trying to do a form using Wicked  #2

@Char0394

Description

@Char0394

Im using Rails 4, I really don't know what more i can do to fix this error :(

User Controller

class UsersController < ApplicationController
def index
end

def show
end

def new
@user = User.new
end

def create
@user = Student.new(user_params)

if @user.save
flash[:success] = 'Welcome to Bilden App!'
sign_in @user
redirect_to user_steps_path(:new, :user_id => @user.id)

else
render :new

end
end

private
def user_params
params.require(:user).permit(:first_name,:last_name, :email, :password, :password_confirmation,:career_code, :extra_credits)
end

end

User steps controller

class UserStepsController < ApplicationController
include Wicked::Wizard
steps :new, :new2

def show
@user = current_user
render_wizard
end

def update
@user = current_user
@user.attributes = user_params
render_wizard @user
end

private

def redirect_to_finish_wizard
redirect_to root_url, notice: "Thank you for signing up."
end

def user_params
params.require(:user).permit(:first_name,:last_name, :email, :password, :password_confirmation,:career_code, :extra_credits)
end
end

View(User steps)

<%= form_for @user, url: wizard_path, method: put do |f| %>

<%= f.submit "Continue" %>
or <%= link_to "skip this step", next_wizard_path %>

<% end %>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions