Skip to content

Commit

Permalink
Added the path & params needed so a new user could create an account
Browse files Browse the repository at this point in the history
  • Loading branch information
danabrit committed Jun 11, 2017
1 parent 6bcdb30 commit 7081216
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base

def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up) do |user_params|
user_params.permit(:username, :first_name, :last_name)
user_params.permit(:username, :first_name, :last_name, :email, :password, :password_confirmation)
end
end
end
4 changes: 2 additions & 2 deletions app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<%= devise_error_messages! %>

<div class="field">
<%= f.label :first_name %><br />
<%= f.label :first_name, "First Name" %><br />
<%= f.text_field :first_name, autofocus: true %>
</div>

<div class="field">
<%= f.label :last_name %><br />
<%= f.label :last_name, "Last Name" %><br />
<%= f.text_field :last_name %>
</div>

Expand Down
6 changes: 3 additions & 3 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<h2>Sign up</h2>
<h2>Sign Up</h2>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>

<div class="field">
<%= f.label :first_name %><br />
<%= f.label :first_name, "First Name" %><br />
<%= f.text_field :first_name, autofocus: true %>
</div>

<div class="field">
<%= f.label :last_name %><br />
<%= f.label :last_name, "Last Name" %><br />
<%= f.text_field :last_name %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<% end %>
<%= menu_group pull: :right do %>
<% if current_user %>
<%= menu_item "Log Out", sign_out_path(current_user) %>
<%= menu_item "Log Out", sign_out_path(current_user), method: :delete %>
<% else %>
<%= menu_item "Log In", sign_in_path %>
<%= menu_item "Sign Up", sign_up_path %>
Expand Down
5 changes: 3 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
resources :projects

devise_scope :user do
get 'sign_in', to: 'devise/sessions#new'
get 'sign_up', to: 'devise/registrations#new'
get 'sign_in', to: 'devise/sessions#new'
get 'sign_up', to: 'devise/registrations#new'
delete 'sign_out', to: 'devise/sessions#destroy'
end

root "projects#index"
Expand Down

0 comments on commit 7081216

Please sign in to comment.