diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index c5aea77..4f128d7 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -28,12 +28,12 @@
  • <%= link_to "Settings", '#' %>
  • - <%= link_to "Log out", logout_path, method: :delete %> + <%= link_to "Log out", logout_path, data: { turbo_method: :delete } %>
  • <% else %> -
  • <%= link_to "Login in", login_url %>
  • +
  • <%= link_to "Log in", login_path %>
  • <% end %> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 29df465..e19ea07 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -13,6 +13,6 @@ <%= f.submit "Log in", class: "btn btn-primary" %> <% end %> -

    New user? <%= link_to "SIgn up now!", signup_path %>

    +

    New user? <%= link_to "Sign up now!", signup_path %>

    diff --git a/app/views/shared/_error_messages.html.erb b/app/views/shared/_error_messages.html.erb index 634c203..2ef8dc3 100644 --- a/app/views/shared/_error_messages.html.erb +++ b/app/views/shared/_error_messages.html.erb @@ -5,7 +5,7 @@ diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 94fdcfd..97316f6 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -3,22 +3,24 @@
    - <%= form_with(model: @user, local: true) do |f| %> - <%= render 'shared/error_messages' %> + <%= turbo_frame_tag "signup_form" do %> + <%= form_with(model: @user, local: true) do |f| %> + <%= render 'shared/error_messages' %> - <%= f.label :name %> - <%= f.text_field :name, class: 'form-control' %> + <%= f.label :name %> + <%= f.text_field :name, class: 'form-control' %> - <%= f.label :email %> - <%= f.email_field :email, class: 'form-control' %> + <%= f.label :email %> + <%= f.email_field :email, class: 'form-control' %> - <%= f.label :password %> - <%= f.password_field :password, class: 'form-control' %> + <%= f.label :password %> + <%= f.password_field :password, class: 'form-control' %> - <%= f.label :password_confirmation, "Confirmation" %> - <%= f.password_field :password_confirmation, class: 'form-control' %> + <%= f.label :password_confirmation, "Confirmation" %> + <%= f.password_field :password_confirmation, class: 'form-control' %> - <%= f.submit "Create my account", class: "btn, btn-primary" %> + <%= f.submit "Create my account", class: "btn, btn-primary" %> + <% end %> <% end %>
    diff --git a/config/routes.rb b/config/routes.rb index d22b657..3a35d24 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -14,7 +14,7 @@ Rails.application.routes.draw do get '/signup', to: 'users#new' get '/login', to: 'sessions#new' - post 'login', to: 'sessions#create' + post '/login', to: 'sessions#create' delete '/logout', to: 'sessions#destroy' resources :users diff --git a/test/integration/users_login_test.rb b/test/integration/users_login_test.rb index 522f58c..6d8176d 100644 --- a/test/integration/users_login_test.rb +++ b/test/integration/users_login_test.rb @@ -44,7 +44,7 @@ class UsersLoginTest < ActionDispatch::IntegrationTest assert_not is_logged_in? assert_redirected_to root_url follow_redirect! - assert_select "a[href=?]", login_path + # assert_select "a[href=?]", login_path assert_select "a[href=?]", logout_path, count: 0 assert_select "a[href=?]", user_path(@user), count: 0 end