Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class UsersController < ApplicationController
- def new
- @user = User.new
- end
- def create
- @user = User.new(params[:user])
- if @user.save
- flash[:notice] = "You signed up successfully"
- flash[:color]= "valid"
- else
- flash[:notice] = "Form is invalid"
- flash[:color]= "invalid"
- end
- render "new"
- end
- end
- <% @page_title = "UserAuth | Signup" %>
- <div class="Sign_Form">
- <h1>Sign Up</h1>
- <%= form_for(:user, :url => {:controller => 'users', :action => 'create'}) do |f| %>
- <p> First name:</br> <%= f.text_field :firstname%> </p>
- <p> Last name:</br> <%= f.text_field :lastname%> </p>
- <p> Email:</br> <%= f.text_field :email%> </p>
- <p> Password:</br> <%= f.password_field :password%></p>
- <p> Password Confirmation:</br> <%= f.password_field :password_confirmation%> </p>
- <%= f.submit :Signup %>
- <% end %>
- <% if @user.errors.any? %>
- <ul class="Signup_Errors">
- <% for message_error in @user.errors.full_messages %>
- <li>* <%= message_error %></li>
- <% end %>
- </ul>
- <% end %>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement