user: only provide #questions as GET
This commit is contained in:
parent
14f32aa3c0
commit
eb7abb33be
|
@ -4,8 +4,11 @@
|
|||
|
||||
- if @more_data_available
|
||||
.d-flex.justify-content-center.justify-content-sm-start#paginator
|
||||
= button_to show_user_questions_path(@user, last_id: @questions_last_id), class: "btn btn-light" do
|
||||
= t("voc.load")
|
||||
= button_to t("voc.load"), show_user_questions_path(@user),
|
||||
class: "btn btn-light",
|
||||
method: :get,
|
||||
params: { last_id: @questions_last_id },
|
||||
form: { data: { turbo_stream: true } }
|
||||
|
||||
- provide(:title, questions_title(@user))
|
||||
- parent_layout 'user/profile'
|
||||
|
|
|
@ -4,5 +4,8 @@
|
|||
|
||||
= turbo_stream.update "paginator" do
|
||||
- if @more_data_available
|
||||
= button_to show_user_questions_path(@user, last_id: @questions_last_id), class: "btn btn-light" do
|
||||
= t("voc.load")
|
||||
= button_to t("voc.load"), show_user_questions_path(@user),
|
||||
class: "btn btn-light",
|
||||
method: :get,
|
||||
params: { last_id: @questions_last_id },
|
||||
form: { data: { turbo_stream: true } }
|
||||
|
|
|
@ -158,7 +158,7 @@ Rails.application.routes.draw do
|
|||
get "/@:username/followers(/p/:page)", to: "user#followers", as: :show_user_followers, defaults: { page: 1 }
|
||||
get "/@:username/followings(/p/:page)", to: "user#followings", as: :show_user_followings, defaults: { page: 1 }
|
||||
get "/@:username/friends(/p/:page)", to: redirect("/@%{username}/followings/p/%{page}"), defaults: { page: 1 }
|
||||
match "/@:username/questions(/p/:page)", to: "user#questions", via: [:get, :post], as: :show_user_questions, defaults: { page: 1 }
|
||||
get "/@:username/questions(/p/:page)", to: "user#questions", as: :show_user_questions, defaults: { page: 1 }
|
||||
get "/:username(/p/:page)", to: "user#show", as: :user_alt, defaults: { page: 1 }
|
||||
get "/:username/a/:id", to: "answer#show", as: :answer_alt
|
||||
get "/:username/q/:id", to: "question#show", as: :question_alt
|
||||
|
|
Loading…
Reference in New Issue