Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5933877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:02:07+00:00 2026-05-22T15:02:07+00:00

I am a Ruby beginner and I’m looking for some help about Devise. My

  • 0

I am a Ruby beginner and I’m looking for some help about Devise.

My problem is with the form for a new user.

I created a user with the Devise view “sign_up” and then I’m redirected to the index of my user class.

If I click on the link “New User” I get the form but without fields for email and password.
So I add these 2 fields but then my new user does not exist, it doesn’t been added to the database.

Does anyone have a solution to this problem?

UPDATE:

Yes I read the tutorial on github.

I’ve make:

rails g devise:install
rails g devise User

and I’ve migrated one table User with original and Devise attributs

#user_controller.rb
class UsersController < ApplicationController
before_filter :authenticate_user!

# GET /users
# GET /users.xml
def index
  @users = User.all

  respond_to do |format|
    format.html # index.html.erb
    format.xml  { render :xml => @users }
  end
end

# GET /users/1
# GET /users/1.xml
def show
  @user = User.find(params[:id])

  respond_to do |format|
    format.html # show.html.erb
    format.xml  { render :xml => @user }
  end
end

# GET /users/new
# GET /users/new.xml
def new
  @user = User.new

  respond_to do |format|
    format.html # new.html.erb
    format.xml  { render :xml => @user }
  end
end

and my form:

 <%= form_for(@user) do |f| %>
      <% if @user.errors.any? %>
        <div id="error_explanation">
          <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>

          <ul>
          <% @user.errors.full_messages.each do |msg| %>
            <li><%= msg %></li>
          <% end %>
          </ul>
        </div>
      <% end %>

  <div class="field">
    <%= f.label :email %><br />
    <%= f.email_field :email %>  
  </div>
  <div class="field">
    <%= f.label :password %><br />
    <%= f.password_field :password %>
  </div>
  <div class="field">
    <%= f.label :password_confirmation %><br />
    <%= f.password_field :password_confirmation %>
  </div>
  <div class="field">
    <%= f.label :nom %><br />
    <%= f.text_field :nom %>
  </div>
  <div class="field">
    <%= f.label :prenom %><br />
    <%= f.text_field :prenom %>
  </div>
  <div class="field">
    <%= f.label :role %><br />
    <%= f.text_field :role %>
  </div>
  <div class="field">
    <%= f.label :date_embauche %><br />
    <%= f.date_select :date_embauche %>
  </div>
  <div class="field">
    <%= f.label :domaine %><br />
    <%= f.text_field :domaine %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

my model:

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable,
     :recoverable, :rememberable, :trackable, :validatable
  attr_accessible :email, :password, :password_confirmation, :remember_me, :nom, :prenom, :role, :date_embauche, :domaine
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:02:08+00:00Added an answer on May 22, 2026 at 3:02 pm

    If you use Devise, you should use it views and controllers to create users.
    Your “New User” link on the users index page should look like:
    <%= link_to 'New User', new_user_registration_path %>

    And to customize Devise views you can run:
    rails generate devise:views

    and then edit rails_root/app/views/devise/registrations/new view

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a beginner in ruby and in programming as well and need help with
Brief question, beginner's work on Ruby/Rails. Here's my view: <h1>News</h1> <%= @posts.each do |post|
I'm having a form in a .erb file, where the user can enter some
Ruby setters—whether created by (c)attr_accessor or manually—seem to be the only methods that need
I am a Ruby beginner. From the book, I know that a Ruby method
I am beginner of Ruby on Rails and use Windows for development. I do
I'm a beginner at Ruby on Rails so I apologize if this is quite
I'm a beginner in ruby-on-rails and I spent my last hour trying to do
I am a beginner to ruby on rails.But i am quite comfortable with php,
I'm a beginner at Ruby On Rails and am trying to get a migration

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.