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 5849607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:01:27+00:00 2026-05-22T13:01:27+00:00

I am new to RoR3 am following along with the RoR3 Michael Hartl Tutorial.

  • 0

I am new to RoR3 am following along with the RoR3 Michael Hartl Tutorial. Out of interest, I want to move the sign-up html form to the home page rather than on a sign-up page. The code for the form:

<%= form_for(@user) do |f| %>
  <div class="field">
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </div>
  <div class="field">
    <%= f.label :email %><br />
    <%= f.text_field :email %>
  </div>

*** more fields ***

  <div class="actions">
    <%= f.submit "Sign up" %>
  </div>
<% end %>

Can’t just be moved to the home page — the code won’t reference the user model properly to create a new user, and so the page doesn’t load. How does one go about accomplishing the goal of moving this form to the home page of the site?

More info: the structure of the site follows the standard rails set-up (user model named user.rb in app/models/user.rb, controller in app/users_controller.rb, views are in app/views where there are folders for pages, layouts, and users folders. The current form is in app/views/users/new.html.erb).

  • 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-22T13:01:28+00:00Added an answer on May 22, 2026 at 1:01 pm

    If the home page, for example, uses the PagesController and the home action, and the route is root :to => "pages#home" or something similar, you need to instantiate the @user variable in the home action:

    class PagesController < ApplicationController
      def home
        @user = User.new
      end
      .
      .
      .
    end
    

    When the form is rendered on the home page, it will have access to the @user variable.

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

Sidebar

Related Questions

New to Flex, what is the nearest equivalent to the following HTML markup in
New to all this so forgive my ignorance. I am trying to figure out
New to LINQ.. I am curious as to the syntax to do the following
im new to ruby and rails. in RoR3 a controller inherits from the ActionController::Base
New to NodeJS. Yes I know I could use a framework, but I want
Developing a new ROR3 website, I need to implement a sort of internal mail
I am trying to add a new page to my RoR3 application that should
New to Rails... here goes: If I want my 'create' method to respond differently
I started a new RoR 3.1 project to test this. I've added the following
New to MVVM...and I am noticing our ViewModel's are doing the following: They are

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.