Im new to the rails platform...i have an issue of saving user sign up information on clicking register in my form....i get no error but on checking the rails console all the user information is equated to nil...cant figure out why. my user steps controller code
class UserStepsController < ApplicationController
include Wicked::Wizard
steps :finishing_step
def show
@user = current_user
render_wizard
end
def update
@user = current_user
if @user.save
redirect_to root_path
else
render_wizard
end
end
def user_params
params.require(:user).permit(:first_name, :middle_name, :last_name, :address_first_line, :address_second_line, :city, :nationality)
end
private
def redirect_to_finish_wizard
redirect_to root_path, notice: "Thanks for signing up."
end
end
below is the code for the users controller
class UsersController < ApplicationController
def create
@user = User.new(params[:user])
if @user.save
redirect_to root_path
else
render_wizard
end
end
end
here below is the code for my simple form with user sign up information
<%= form_for User.new, url: wizard_path do |f| %>
<div><%= f.label :first_name, "First Name" %><br />
<%= f.text_field :first_name %></div>
<div><%= f.label :middle_name, "Middle Name" %><br />
<%= f.text_field :middle_name %></div>
<div><%= f.label :last_name, "Last Name" %><br />
<%= f.text_field :last_name %></div>
<div><%= f.label :phone_number, "Phone Number" %><br />
<%= f.text_field :phone_number %></div>
<div><%= f.label :date_of_birth, "Date of Birth" %><br />
<%= f.date_select :date_of_birth, start_year: 1900 %></div>
<div><%= f.label :address_first_line, "Address (first line)" %><br />
<%= f.text_field :address_first_line %></div>
<div><%= f.label :address_second_line, "Address (second line)" %><br />
<%= f.text_field :address_second_line %></div>
<div><%= f.label :city, "City" %><br />
<%= f.text_field :city %></div>
<div><%= f.label :nationality, "Nationality" %><br />
<%= country_select(:user, :nationality, {selected: "UG"}) %></div>
<div>
<%= f.label :avatar %>
<%= f.file_field :avatar %>
</div>
<div>
<%= f.label :terms_of_service, "Agree to Terms of Service" %> <br>
<%= f.check_box :terms_of_service %>
</div>
<%= f.submit "Register", class: "btn btn-primary" %>
<% end %>
for any help thanks in advance