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

  • SEARCH
  • Home
  • 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 7954771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:31:52+00:00 2026-06-04T03:31:52+00:00

I have signup form on my home screen. If user inputs invalid data I

  • 0

I have signup form on my home screen. If user inputs invalid data I redirect him to /signin page. On this page I can see filled fields, but errors descriptions are empty.

Here is my UsersController:

class UsersController < ApplicationController
  def new
    @user = User.new(params[:user])
  end

  def create
    @user = User.new(params[:user])
    print @user
    if  @user.save

    else
      render 'new'
    end
  end
end

Method I use to show errors

module ApplicationHelper

  def errors_for(model, attribute)
    if model.errors[attribute].present?
      content_tag :div, :class => 'well error' do
        content_tag :ul do
          model.errors[attribute].collect {|item| concat(content_tag(:li, item))}

        end
      end
    end
  end
end

My form partial:

<%= f.label :user_name %>
<%= f.text_field :user_name, :class=>"input-medium" %>
<%= errors_for(@user, :user_name) %>

<%= f.label :email %>

<%= f.text_field :email, :class=>"input-medium " %>

<%= errors_for(@user, :email) %>

<%= f.label :password %>

<%= f.password_field :password, :class=>"input-medium" %>

<%= f.label :password_confirmation, "Confirmation" %>

<%= f.password_field :password_confirmation, :class=>"input-medium" %>

and my signup view:

<section class="centered user-form-container">
  <div class="user-form well pull-left">
    <div class="centered">
      <h1>Sign up</h1>
      <%= form_for(@user, :action=>"create") do |f| %>
          <%= render 'signup', :f=>f %>
          <%= f.submit "Sign up" %>

      <% end %>
    </div>
  </div>

</section>
  • 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-06-04T03:31:54+00:00Added an answer on June 4, 2026 at 3:31 am
      def new
        @user = User.new(params[:user])
        if (!params[:user].nil?)
          @user.valid?
        end
    
    
      end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a signup form on my home page which uses server side validation
I have a signup form where I'm validating user input. Here's my controller: <?php
I have a form allowing a user to signup for a news letter which
Simple scenario: I have a signup form, with user name, password, email address, may
I have just finished creating my signup form and now ready to insert data
I have a signup form of which most fields are pre-filled using user's Facebook
I have a user signup form, and I need to insert a function to
I have a simple user signup form with a checkbox that lets users get
I have made a user signup form in asp.net. I want to check the
I have a signup form that needs to be loaded for every page of

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.